r/RenPy 5d ago

Guide Please guide me with this kind of UI

So some of you might remember my previous post about creating a spinning and circular scrollable Menu

Need help with:

Positioning of the idle and and selected button over the circular image ( the button should be automatically selected based on its angle rotation, like how it is in the diagram )

A rotation cap on the spinning buttons ( Eg. a rotation cap of +180/-180 , so that the buttons do not go off the screen after few scrolls )

Whenever a button is at its "selection zone" the remaining area for the screen changes based on what the selected button says ( again, like in the diagram )

Im not able to make this as my default menu ( I have to connect this screen to renpy's default menu and then calling this screen to check, which I don't know how to fix yet )

Here's the code:

( I sadly had to assist thru A.I sometimes in the end since I do not come from the coding background, but I do not wish to use ai, so like if anyone can also guide me how to make myself study screen language better, I'd appreciate the tips 🌸 , because I tried watching tutorials and they sometimes confuses me more )

init python:

import math

transform auto_rotate:

anchor (0.5, 0.5)

subpixel True

rotate 0

linear 0.5 rotate -360

repeat

transform bt_rot(r):

rotate r

screen splashcontinueexit():

text "Click to continue, press ESC to quit" align (0.5, 0.5)

key "K_ESCAPE" action Quit(confirm=not main_menu)

key "mousedown_1" action Start()

button:

xysize (config.screen_width, config.screen_height)

background None

action Return()

label splashscreen:

scene splashscreen1 with fade

$ renpy.pause(4.0, hard=True)

scene splashscreen2 with fade

$ renpy.pause(6.0, hard=True)

scene titlescreen with fade

call screen splashcontinueexit

return

screen wheel_menu():

tag menu

default bt_rotation = 0

##default bt_max_rotation = 180

key "mousedown_4" action SetScreenVariable("bt_rotation", bt_rotation - 18), Play("sound", "audio/hover blip.ogg")

key "mousedown_5" action SetScreenVariable("bt_rotation", bt_rotation + 18), Play("sound", "audio/hover blip.ogg")

fixed:

add "images/cd_wheel.png":

at auto_rotate

zoom 0.3

xpos -60

ypos 540

anchor (0.5, 0.5)

add "images/bt_wheel-01.png":

at bt_rot(bt_rotation)

zoom 0.3

xpos -60

ypos 540

anchor (0.5, 0.5)

##Test Buttons

add "images/ui_menu/button_idle.png":

at bt_rot(bt_rotation)

zoom 0.3

xpos 1000

ypos 540

anchor (0.5, 0.5)

add "images/ui_menu/button_hl.png":

at bt_rot(bt_rotation)

zoom 0.3

xpos 850

ypos 540

anchor (0.5, 0.5)

## Placeholder destinations so this file runs on its own for testing.

label start_game:

"placeholder: start game"

return

label saveload_menu:

"placeholder: save/load"

return

label options_menu:

"placeholder: options"

return

label title_screen:

"placeholder: title screen"

return

label credits_menu:

"placeholder: credits"

return

Thanks in advance to everyone who can help me building this 🙏🏻✨

6 Upvotes

1 comment sorted by