renpy
renpy copied to clipboard
Perspective True on screens layer breaks buttons.
If you use:
camera screens:
perspective True
to enable 3D stage stuff on the screens layer, then all buttons on that layer are unclickable. You can still progress dialogue thankfully, but you can't quit the game through the confirm screen or navigate the game menu until you call:
camera screens
to reset it back to normal.
I know this is pretty niche but I am making text tags that accept atl to do text effects, so being able to do 3D stage ATLs on text would be very nice.
https://user-images.githubusercontent.com/46580818/126404867-e7ef3344-a773-47ca-bfb1-99312aeb8be1.mp4
I'll see what I can do, but this is something I'll work on after 7.4.7 is out. I suspect it will work in some but not all cases.
One thing you can do is to enable perspective on a per-screen basis:
screen say(...):
fixed:
at Transform(perspective=True)
# The rest of the screen.
Yeah. And could also define a layer just for a say screen as well that keeps all the buttons on the screens layer as well. And I know it's probably a technical hurdle likely requiring something that checks can project the mouse position in to the 3D space.
But never been a fan of telling ppl they can't do something or have to a big setup for a thing to work. So it'd be appreciated for sure. But yeah, 7.4.7 comes first.
Actually might not be necessary. Having a character use show_layer to put the say screen on a layer other than the screens layer works just as well. Included instructions on how to do that with my new kinetic text tags stuff. So people should be able to know how to work around the issue. But if you do find a way to fix it, I'm sure it'd be cool to see. I'll leave the issue open if it helps, but you're free to close it if it's not something you care to worry about.
~~Irrelevant tangent~~ Sidenote: Thanks for the update to the transforms on screens in 7.4.7. Likely will have fixed a couple issues I was having recently on some projects. But will admit I did have a bit of a panic when I updated and found the time_offset I was applying to the ATL in my new atl text tag wasn't working anymore. Hopefully you don't mind I kinda had to undermine the update a bit by just forcing the atl_st_offset to be at 0 when the text is rendered. But I mostly imagine the ATL text tag being used in the primary script, where the 'what' text is displayed along with the screen. So can't imagine it being an issue for most hopefully. Though if there was a better workaround, let me know.
Maybe I should've had it just do a 0 time render upon first rendering instead of instantiation? You're free to look it over if you want. https://github.com/SoDaRa/Kinetic-Text-Tags/blob/main/game/atl_text_tag.rpy
Can you take a look at 7.4.8 when it comes it? There was a fix to atl_st_offset that probably has the effect of making it 0 in most cases.
Since I think it might be related I post it here: there is also issues when displaying screens on the "master" layer when perspective is enabled. (The idea was to have clickable characters so the player can choose whom to speak to).. Buttons become unclickable if their x/y pos is set, whereas they capture every click if xpos and ypos are not set. (Renpy version 7.4.8.1895).
Is there any update of this bug? We want to make the ui like: https://www.gameuidatabase.com/uploads/Arknights01252021-022516-59641.jpg This bug is a blocker. Thanks!
Oh hey someone else ran into this problem huh. I was trying to do something like this only to run into this issue.
Here is a demo with an angled menu. The buttons lose hover reaction while perspective is set to true, and regain it if commented out.
# The script of the game goes in this file.
define e = Character("Eileen")
# The game starts here.
label start:
show screen title_menutest
$ ui.interact()
# This ends the game.
return
transform title_phonemenu_trans:
anchor(0.0, 0.0)
matrixanchor(0.0, 0.0)
point_to (0.0, 0.0, 0.0)
pos (0, 0)
perspective True
orientation (0, 26, 0)
screen title_menutest:
add "#bbb"
vbox:
at title_phonemenu_trans
style_prefix "navigation"
frame:
background "#0ff"
xysize(2, 2)
frame:
has vbox
spacing 2
textbutton _("NEW GAME"):
action NullAction()
textbutton _("LOAD GAME"):
action NullAction()
textbutton _("OPTIONS"):
action NullAction()
textbutton _("QUIT GAME"):
action NullAction()
(Being that said, getting a menu precisely where I want it to be has been a right headache, as the anchor point is never where I expect it to be, despite trying matrixanchor, as you can see in this example where I wanted the top-left corner actually at zero while testing things, but in-game it's somewhere in the middle.)
I guess my next best bet is to just precompose angled graphics, assuming interaction sensitivity can be wrapped to alpha. (And if not, I'll just have to fudge it somehow.)
I believe this would requiere complete rework of focus system to something like "raycast for each layer to find first focused item".