CLEO Help Load any image file (.png, .bmp)

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Is there any opocde or method that directly loads an individual image file (can be .png, .bmg) and shows it on screen rather than loading it by creating a txd dictionary and loading it?

I don't want to do my work with these opocdes as they require to be in the specific txd file:

Code:
0390: load_txd_dictionary 'LD_BEAT'
038D: draw_texture 17 position $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 size 20@ 19@ RGBA 128 128 128 255

I want to load any image file by specifying its directory instead of importing it in a txd dictionary and restarting the game.
 

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
If you are using SAMPFUNCS then you can use
0B73: render draw_texture 0@ pos 1@ 2@ size 3@ 4@ rotation 5@ color 6@

search the forums for that opcode for some tips on how to use it.

without sampfuncs, you’d have to add a image to a specific txd file (can’t remember which) and then load it from that.
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
@ItsRobinson

Code:
0B71: render 2@ = load_texture_from_file "CLEO\ok.png"
0B73: render draw_texture 2@ pos 220.0 350.0 size 40.0 40.0 rotation 0.0 color 16777215

Not working
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Check if your image exists, and that load it. U must do it on loop!. For example:
Code:
If
0AAB: file_exists "CLEO\test.png"
Then
0B71: render 0@ = load_texture_from_file "cleo/test.png"
0B73: render draw_texture 0@ pos 240 240 size 564 564 rotation 0 color -1

Pos is your screen position. Size, is your image size. U only can load .png photo format
Code:
0B73: render draw_texture 0@ pos 240 240 size 564 564 rotation 0 color -1
 
Status
Not open for further replies.
Top