-
-
Notifications
You must be signed in to change notification settings - Fork 52
Adding :ui argument to hide #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If you use the ui-pass, it's always rendered to a texture already as part of the pass. |
Or in other words: rendering to a texture is orthogonal to the object being registered with the scene. You could also still register the UI with scene without entering it fully. So this seems like an unnecessary change. As for why not let hide take keys, it seems a bit like a hack, doesn't it? I'm not sure when you'd ever really want to pass arguments otherwise. |
If you could describe in a bit more detail what you're trying to do I could figure out how to properly accommodate what you want. |
I'm making a card game and I want to use Alloy to lay out the cards - essentially make a texture for each card, put that on a quad, and have the UI render to it. Occasionally the cards need to change, so I need to update the UI. The way I was trying to do this was by having a panel for each card that the UI goes on, removing that panel and adding a new one. Are panels just the wrong way to go about this? |
Panels encompass "layers" of UI. So the entire HUD would be a panel, the pause menu would be a panel, etc. For the cards you'd probably not want to use Alloy at all, but rather a standard game entity, that way you can apply shaders and all the usual fun stuff. Simply combining |
There is also the option to "bridge" back into Trial via a custom Alloy component that then renders via Trial's usual mechanisms, but I'm not yet sure why you want to use Alloy for the cards? |
The cards can't have a static texture because I sometimes need to update text and icons on them dynamically in ways I can't necessarily predict in advance. So for example you could have a card in your hand that says "deal 5 damage" and another card that says "your cards deal double damage this turn," then I'd want to update the first card to show how much damage it's actually going to do (probably in green to indicate it's buffed, not the base damage). Alloy seemed like the obvious way to do stuff like this while having the text realign itself to still look good when the numbers get huge. |
I see, yes, if you need to do dynamic text drawing then Alloy is currently the only option. I'm still not convinced you need to render to a texture, though. I'd probably try to represent the card as an Alloy layout-element and define necessary shapes to represent the card background and needed info. Then just... create the element and place it where you like. You could then use a |
Well, I'd like to have the cards exist in 3d space for effects reasons, like if I need to animate flipping a card over, or if there's a particle effect that I want to go in front of the card. I guess for the latter I could use a blend pass but it would still be cool if I could rotate the cards. |
Hmmm. Alloy does have a transforms system similar to Trial, but its transform matrix is restricted to 3x3 rather than 4x4, so it can't do 3D transformations of elements. I still think that rendering to a texture is far too restrictive and ultimately the wrong approach for this, but I don't have a good solution handy right now either I'm afraid. |
I'll work on a revision of Alloy that allows true 3D transforms, but it'll be a bit before that's ready. |
The other common approach I've seen to do this kind of thing is to use a text mesh system, so the text is a translucent quad / bunch of quads hovering slightly over the main card mesh. This works but it means you can't use a bunch of the layout stuff that a proper UI system would allow, and it can sometimes look kind of janky when the card is rotated. I thought about doing something like that but it didn't seem worth implementing given the engine not having built-in support for it (unless I completely missed it in the code/docs). |
Alloy already works this way, and I see no point in adding a separate text system to Trial, given how insanely complicated text is. |
Yeah, I brought it up on the off chance I had missed something that would have made it easy to do, but if there isn't it's probably not worth implementing. |
Trial does have the |
I'm doing some stuff where I need to render UI to a texture, which breaks
hide
on panels since it wants to look for the panel in the ui of the current scene. Is there any reason not to do something like this: master...aetiusluna:trial:masterThe text was updated successfully, but these errors were encountered: