I couldn't find a way to get or set the position of an image in python, since we call them (the images) with their names (strings).
I want to achieve something like this :
Code: Select all
$ Image1.position = Image2.position
Code: Select all
$ Image1.position = Image2.position
It is, but there should be a better way to do whatever it is that you're trying to do.Areski wrote:Do you think it is possible?
Code: Select all
image meow = Solid("F00", xysize=(100, 100))
image meow2 = Solid("FFF", xysize=(100, 100))
label start:
show meow at Transform(align=(.5, .5)) as img
pause
show meow2 as img
pause
Code: Select all
image meow = Solid("F00", xysize=(100, 100))
image meow new = Solid("FFF", xysize=(100, 100))
label start:
show meow:
align (.5, .5)
pause
show meow new
pause
Thanks, but the thing is, the image will be moved after being "shown", so I have to get the actual transform (and I really would like to use a python function to show the image)xela wrote:Under what conditions? I though if you just showed a new image with the same tag transform properties like position would be carried over? Or not?
LoL I haven't used normal VN stuff for so long I can barely remember the basics
Edit:
Yeap, I was right:
It is shown at the same position.Code: Select all
image meow = Solid("F00", xysize=(100, 100)) image meow2 = Solid("FFF", xysize=(100, 100)) label start: show meow at Transform(align=(.5, .5)) as img pause show meow2 as img pause
Code: Select all
$ renpy.show('image2', at_list=[Position(xpos=image1.posX,ypos=image1.posY)])
Please note (I already mentioned this before):Areski wrote:Code: Select all
$ renpy.show('image2', at_list=[Position(xpos=image1.posX,ypos=image1.posY)])
Code: Select all
$ temp = renpy.display.core.displayable_by_tag("master", "image1") # Layer: 'master', Tag: 'image1'
Code: Select all
show image2:
pos (temp.xpos, temp.ypos)
Code: Select all
$ placement = temp.get_placement()
Code: Select all
$ temp = renpy.display.core.displayable_by_tag("master", "image1") # Layer: 'master', Tag: 'image1'
$ renpy.show('image2', at_list=[Transform(xpos=temp.xpos, ypos=temp.ypos)]
xela wrote:Code: Select all
$ temp = renpy.display.core.displayable_by_tag("master", "image1") # Layer: 'master', Tag: 'image1' $ renpy.show('image2', at_list=[Transform(xpos=temp.xpos, ypos=temp.ypos)]
Code: Select all
AttributeError: 'NoneType' object has no attribute 'xpos'
Code: Select all
renpy.display.core.displayable_by_tag()
How to use it with SCREENS?
Code: Select all
init:
transform walk_to(x1, x2, t=5.0):
xpos x1
linear t xpos x2
screen test:
add "kid" at walk_to(200, 400) id "kid"
label start:
show screen test
pause
return
Users browsing this forum: Google [Bot]