philat wrote:Well, images don't have hover states, so... Use a screen.
Code: Select all
screen blah():
add "sr" at right
imagebutton:
idle "sl"
hover "sl"
at open
action NullAction()
label start:
show screen blah()
pause
I don't know how I ended up using images, I started off with imagebuttons...
Anyway, I did what you said, and I get an error:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00start.rpy", line 209, in script
python:
File "renpy/common/00start.rpy", line 213, in <module>
renpy.call_in_new_context("_main_menu")
Exception: Parameter 'new_widget' is not known by ATL Transform.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\bootstrap.py", line 281, in bootstrap
renpy.main.main()
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\main.py", line 463, in main
run(restart)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\main.py", line 139, in run
renpy.execution.run_context(True)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\execution.py", line 714, in run_context
context.run()
File "renpy/common/00start.rpy", line 209, in script
python:
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\ast.py", line 805, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\python.py", line 1460, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/00start.rpy", line 213, in <module>
renpy.call_in_new_context("_main_menu")
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\game.py", line 313, in call_in_new_context
return renpy.execution.run_context(False)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\execution.py", line 714, in run_context
context.run()
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
$ ui.interact()
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\ast.py", line 805, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\python.py", line 1460, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
$ ui.interact()
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\ui.py", line 277, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\display\core.py", line 2354, in interact
repeat, rv = self.interact_core(preloads=preloads, **kwargs)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\display\core.py", line 2564, in interact_core
new_widget=layers_root)
File "C:\Users\Imperf3kt\Desktop\renpy\renpy-6.99.7-sdk\renpy\atl.py", line 392, in __call__
raise Exception('Parameter %r is not known by ATL Transform.' % k)
Exception: Parameter 'new_widget' is not known by ATL Transform.
Windows-8-6.2.9200
Ren'Py 6.99.7.858
test button 0.0
I get this by using:
Code: Select all
image sr = "scroll_right.png"
transform open:
on hover:
xalign 0.0 yalign 0.0
linear 0.3 xalign -0.5 yalign 0.0
screen Blah():
add "sr" at right
imagebutton auto "scroll_left_%s.png" xpos 0 ypos 0 focus_mask True action NullAction() at open
label start:
show screen Blah()
pause
return
The exact same error when using:
Code: Select all
image sr = "scroll_right.png"
image sl = "scroll_left.png"
transform open:
on hover:
xalign 0.0 yalign 0.0
linear 0.3 xalign -0.5 yalign 0.0
screen Blah():
add "sr" at right
imagebutton:
idle "sl"
hover "sl"
at open
action NullAction()
label start:
show screen Blah()
pause
return
The image is all over the place too, it's not where it should be.
http://puu.sh/n8B1l/8ea48e2e07.png
If I click anything, the errors appear and the game crashes.
I even tried placing the code in the screens.rpy
Screens:
Code: Select all
init -1:
image sr = "scroll_right.png"
image sl = "scroll_left.png"
screen Blah():
add "sr" at right
imagebutton:
idle "sl"
hover "sl"
at open
action NullAction()
Script:
Code: Select all
transform open:
on hover:
xalign 0.0 yalign 0.0
linear 0.3 xalign -0.5 yalign 0.0
label start:
show screen Blah()
pause
return
I don't understand this at all.