using images as variable[solved]
Posted: Fri Dec 11, 2020 11:39 pm
I'm trying to use a random picked image of a scratch to appear, but I can't get the image to show up correctly?
This is the code I'm using to try to randomly pick an image, and using this:
to try to show it at a userdefined location, but it just shows up as a shadow.
The image is in the right location, if i write show scratch4 then it shows up fine but I can't get it down in this way!
Code: Select all
label scratch_pic:
$ scratch= "should be image"
$ scratch6 = 'images/scratch6.png'
$ scratch5 = 'images/scratch5.png'
$ scratch4 = 'images/scratch4.png'
$ scratch3 = 'images/scratch3.png'
$ scratch2 = 'images/scratch2.png'
$ scratch1 = 'images/scratch1.png'
$r = renpy.random.randint(1,6)
"[scratch] [r]"
if r == 1:
$scratch = scratch1
if r == 2:
$scratch = scratch2
if r == 3:
$scratch = scratch3
if r == 4:
$scratch = scratch4
if r == 5:
$scratch = scratch5
if r == 6:
$scratch = scratch6
returnCode: Select all
show scratch at ec1The image is in the right location, if i write show scratch4 then it shows up fine but I can't get it down in this way!