Ren'Py Help with re scaling

MasterKrull

Newbie
Game Developer
Apr 25, 2017
93
44
i m tring to learn ren py but there is a code crucial to me that is im.scale, and i cant make it work.

this image for example

cidade.jpg


using the comand

image cidade = im.Scale("cidade", 1280, 720)

this happens

Code:
I'm sorry, but an uncaught exception occurred.

While loading <'Scale' <'Image' u'cidade'> 1280 720 True>:
  File "game/script.rpy", line 30, in script
    menu:
IOError: Couldn't find file 'cidade'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 30, in script
    menu:
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\ast.py", line 1628, in execute
    choice = renpy.exports.menu(choices, self.set, args, kwargs, item_arguments)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\exports.py", line 990, in menu
    rv = renpy.store.menu(new_items)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\exports.py", line 1226, in display_menu
    rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\core.py", line 3194, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\core.py", line 2094, in draw_screen
    renpy.config.screen_height,
  File "renpy/display/render.pyx", line 490, in renpy.display.render.render_screen (gen\renpy.display.render.c:6805)
    rv = render(root, width, height, st, st)
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\layout.py", line 722, in render
    surf = render(child, width, height, cst, cat)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "accelerator.pyx", line 110, in renpy.display.accelerator.transform_render
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\image.py", line 500, in render
    return wrap_render(self.target, width, height, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\image.py", line 306, in wrap_render
    rend = render(child, w, h, st, at)
  File "renpy/display/render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:4075)
    cpdef render(d, object widtho, object heighto, double st, double at):
  File "renpy/display/render.pyx", line 259, in renpy.display.render.render (gen\renpy.display.render.c:3520)
    rv = d.render(widtho, heighto, st, at)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\im.py", line 583, in render
    return cache.get(self, render=True)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\im.py", line 266, in get
    surf = image.load()
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\im.py", line 808, in load
    child = cache.get(self.image)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\im.py", line 266, in get
    surf = image.load()
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\display\im.py", line 628, in load
    surf = renpy.display.pgrender.load_image(renpy.loader.load(self.filename), self.filename)
  File "C:\Users\User\Desktop\Ren'py\renpy-7.3.1-sdk\renpy\loader.py", line 576, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'cidade'.

Windows-8-6.2.9200
Ren'Py 7.3.5.606
teste 02 1.0
Sun Apr 19 03:40:58 2020
 

yuqiu314

New Member
May 4, 2018
5
3
Don't forget the file extension, such as png, jpg, etc.

Maybe you should write like this -
Code:
image cidade = im.Scale("cidade.jpg", 1280, 720)

And make sure the file path is right.
Renpy will search for assets in the root & "images/" folder both.
 
  • Like
Reactions: MasterKrull

MasterKrull

Newbie
Game Developer
Apr 25, 2017
93
44
Don't forget the file extension, such as png, jpg, etc.

Maybe you should write like this -
Code:
image cidade = im.Scale("cidade.jpg", 1280, 720)

And make sure the file path is right.
Renpy will search for assets in the root & "images/" folder both.
thank you very much.

its alive, its aliiiiiiiiiiiiive

tenor.gif