I'm currently working on a dev screen for a visual novel.
I'm having problem with setting camera settings on the go. Let me explain
Code: Select all
# the variables
default camera_zoom = 1.0
default camera_xpos = 0
default camera_ypos = 0
screen dev_screen():
###
the rest of the code
###
if camera_ctrl: # A value to change on a keypress so I can hide the window anytime I want
frame:
align (0.0,1.0)
xsize 512
hbox:
vbox:
grid 3 3:
button:
text "zoom = [r_zoom]"
action [SetVariable("camera_zoom", 1.0), Call("set_camera")] #This button displays the current zoom and sets it back to default if I want to
if camera_zoom > 0:
button:
text "<"
action [SetVariable("camera_zoom", camera_zoom - 0.05), Call("set_camera")] # Incrementing the value down and making change on the go
else:
text "<"
if camera_zoom < 10.0:
button:
text ">"
action [SetVariable("camera_zoom", camera_zoom + 0.05), Call("set_camera")] # Incrementing the value down and making change on the go
else:
text ">"
button:
text "xalign = [camera_xpos]"
action [SetVariable("camera_xpos", 0), Call("set_camera")]
bar:
xmaximum 246
value VariableValue("camera_xpos", 1920*2, offset=-1920) # a bar value for the xpos in camera
text ""
button:
text "yalign = [camera_ypos]"
action [SetVariable("camera_ypos", 0), Call("set_camera")]
bar:
xmaximum 246
value VariableValue("camera_ypos", 1080*2, offset=-1080) # a bar value for the xpos in camera
text ""
grid 2 1:
button:
text "SET"
action Call("set_camera") # Calls the label to change camera settings
button:
text "Default"
action Call("set_def_camera") # sets the camera back to normal
if config.developer == True:
init python:
config.per_frame_screens.append("dev_screen") #Ading the screen
config.overlay_screens.append("dev_screen") #Ading the screen
label set_camera():
[b]call set_def_camera[/b]
pause 1
camera:
pos (camera_xpos, camera_ypos)
zoom camera_zoom
return
label set_def_camera():
camera:
pos (0, 0)
zoom 1
return
Could I get some help with that because I don't know what I am missing here ;-;
Currently I am using renpy 8.0.2 - I think I would preferably revert to a version where the 3d camera works better so I could add maybe more animation but that's a plan for the future - now I need a simple way to make animations with camera so I can test it in the game and write down the values to make quick coding :v
Thanks if anyone replies and I am sorry if my English don't sound that good :/