As title says, I got problem with viewport. I need to control the values of its scrollbars. So, I found this thread
http://lemmasoft.renai.us/forums/viewto ... adjustment
and made my viewport like
Code: Select all
python:
def my_vp():
xadj = ui.adjustment(value=store.xvalue, changed=store_xvalue)
yadj = ui.adjustment(value=store.yvalue, changed=store_yvalue)
ui.side(('c'), xpos=100, ypos=50, spacing=5)
vp = ui.viewport(xadjustment = xadj, yadjustment = yadj, draggable=True, mousewheel=True, xmaximum=400, ymaximum=400, child_size=(800, 600))
ui.fixed()
ui.image("mainmenu.jpg")
for button in menu_buttons:
ui.textbutton (button[0], clicked = button[1], background=None)
ui.close()
ui.close()
config.overlay_functions.append(my_vp)
Then I've changed this code to screen language:
Code: Select all
screen my_scr:
tag game_field
zorder 40
$ xadj = ui.adjustment(value=store.xvalue, changed=store_xvalue)
$ yadj = ui.adjustment(value=store.yvalue, changed=store_yvalue)
side "c":
area (0, 0, game_window_size_x, game_window_size_y)
viewport id "game_field_vp":
child_size (area_size_x+20, area_size_y+20)
draggable True
xadjustment xadj
yadjustment yadj
Have I missed smth or used "xadj" and "yadj" in wrong place or... I don't know...?
Desperately need help to fix it...))
Thanks in advance.