CLEO Help How do i show / hide a picture?

CLEO related
Status
Not open for further replies.

downloadstuff

Active member
Joined
Apr 4, 2015
Messages
82
Reaction score
0
I found out a snippet to show an image and it worked properly but i cant hide it now.

it renders but i want it to disappear after 10 seconds, but it just shows forever. i think it may be stuck inside while true loop, but how would i wait for it to render and then make it disapear 10 seconds after the image is fully loaded?

thanks.

here is the snipet

Code:
repeat
wait 40
until 0AFA:

while 8B71: render 0@ = load_texture_from_file "CLEO\IMAGE.png"
wait 0

end


while true
wait 0
    03F0: 1
    0B73: render draw_texture 0@ pos 320 240 size 50 50 rotation 0.0 color 0xFFFFFFFF
end
wait 10000
03F0: enable_text_draw 0 
0391: release_textures  
0AD1: show_formatted_text_highpriority "its hidden" time 1500 
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
idk if 0B73 has to be called every frame but in case if it does then you could do something like:
Code:
while true
    wait 0
    33@ = 0 //33@ is a timer, after you set it to some value it will increase 1 per 1 millisecond

    while 001B:   10000 > 33@
        03F0: 1
        0B73: render draw_texture 0@ pos 320 240 size 50 50 rotation 0.0 color 0xFFFFFFFF
    end

    0AD1: show_formatted_text_highpriority "its hidden" time 10000
    wait 10000
end

this way the image is displayed for 10 seconds, then disappears for 10 seconds and repeats the cycle forever
 

downloadstuff

Active member
Joined
Apr 4, 2015
Messages
82
Reaction score
0
monday link said:
idk if 0B73 has to be called every frame but in case if it does then you could do something like:
Code:
while true
    wait 0
    33@ = 0 //33@ is a timer, after you set it to some value it will increase 1 per 1 millisecond

    while 001B:   10000 > 33@
        03F0: 1
        0B73: render draw_texture 0@ pos 320 240 size 50 50 rotation 0.0 color 0xFFFFFFFF
    end

    0AD1: show_formatted_text_highpriority "its hidden" time 10000
    wait 10000
end

this way the image is displayed for 10 seconds, then disappears for 10 seconds and repeats the cycle forever
with 03F0: 1 it freezes and crashes me.
i tried replacing it with 33@++, i dont crash but it instantly disappears.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
my bad, sorry, forgot to add "wait 0" after "while" so it should be:

while 001B:  10000 > 33@
wait 0
 

downloadstuff

Active member
Joined
Apr 4, 2015
Messages
82
Reaction score
0
monday link said:
my bad, sorry, forgot to add "wait 0" after "while" so it should be:

while 001B:  10000 > 33@
wait 0

it worked thanks.

if someone need it:
full working snippet code is:

Code:
repeat
wait 40
until 0AFA:

while 8B71: render 0@ = load_texture_from_file "CLEO\IMG.png"
wait 0

end


    wait 0
    33@ = 0 //33@ is a timer, after you set it to some value it will increase 1 per 1 millisecond

   while 001B:   10000 > 33@
    wait 0
        03F0: 1
        0B73: render draw_texture 0@ pos 300 200 size 50 50 rotation 0.0 color 0xFFFFFFFF
    end
 
Status
Not open for further replies.
Top