I see a difference between Windows and Android versions, want to clarify, it’s intended.
It took me a while to isolate it due to Android slow build process.
The script below works fine on Windows.
It fails on Android with uncaught exception:
Code: Select all
File "game/script.rpy", line 9, in <module>
Exception: Displayables may not be rendered during the init phase.
define credits_text = '...'
The error will change to:
Code: Select all
AttributeError: 'NoneType' object has no attribute 'draw_per_virt'
Code: Select all
# "start" # 3
script.rpy
Code: Select all
define credits_text = '{image=center.png}' # 1
#define credits_text = '...' # 2
define credits_textd = Text(credits_text, color='#ffffff', text_align=0.5)
label start:
# "start" # 3
$devlog.info("start")
$credits_text_size = credits_textd.size()
"done"
$devlog.info("done")
$renpy.quit()
return
# auto start
label main_menu:
return
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 9, in <module>
Exception: Displayables may not be rendered during the init phase.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "/data/user/0/test2.tst/files/renpy/bootstrap.py", line 305, in bootstrap
renpy.main.main()
File "/data/user/0/test2.tst/files/renpy/main.py", line 499, in main
run(restart)
File "/data/user/0/test2.tst/files/renpy/main.py", line 147, in run
renpy.execution.run_context(True)
File "/data/user/0/test2.tst/files/renpy/execution.py", line 795, in run_context
context.run()
File "script.rpyc", line 9, in script
File "/data/user/0/test2.tst/files/renpy/ast.py", line 827, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/data/user/0/test2.tst/files/renpy/python.py", line 1764, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 9, in <module>
File "/data/user/0/test2.tst/files/renpy/text/text.py", line 1727, in size
renders[i] = renpy.display.render.render(i, width, self.style.size, st, at)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen/renpy.display.render.c:3445)
File "renpy/display/render.pyx", line 143, in renpy.display.render.render (gen/renpy.display.render.c:2308)
Exception: Displayables may not be rendered during the init phase.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 9, in <module>
AttributeError: 'NoneType' object has no attribute 'draw_per_virt'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "/data/user/0/test2.tst/files/renpy/bootstrap.py", line 305, in bootstrap
renpy.main.main()
File "/data/user/0/test2.tst/files/renpy/main.py", line 499, in main
run(restart)
File "/data/user/0/test2.tst/files/renpy/main.py", line 147, in run
renpy.execution.run_context(True)
File "/data/user/0/test2.tst/files/renpy/execution.py", line 795, in run_context
context.run()
File "script.rpyc", line 9, in script
File "/data/user/0/test2.tst/files/renpy/ast.py", line 827, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/data/user/0/test2.tst/files/renpy/python.py", line 1764, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 9, in <module>
File "/data/user/0/test2.tst/files/renpy/text/text.py", line 1729, in size
layout = Layout(self, width, height, renders, size_only=True)
File "/data/user/0/test2.tst/files/renpy/text/text.py", line 472, in __init__
self.oversample = renpy.display.draw.draw_per_virt
AttributeError: 'NoneType' object has no attribute 'draw_per_virt'