GameMaker: Studio

GameMaker: Studio

View Stats:
Kihunter 24 Jan, 2015 @ 2:13pm
draw_sprite_ext Not Working
I've been trying to get this simple line of code to draw a sprite, but no matter what I do, it won't draw the sprite.

draw_sprite_ext( sprite_name, 0, x, y, 1, 1, 0, c_whatever, 1 );

Did I type it in wrong, or is there another bit of code I need to make this work?
< >
Showing 1-11 of 11 comments
Sera 24 Jan, 2015 @ 2:57pm 
You seem to have the arguments right (obviously accounting for the end result not being c_whatever and such). Are you calling it in the Draw event?
CatOnMushroom 25 Jan, 2015 @ 8:09pm 
and maybe add the line: draw_self(); before the draw_sprite_ext
Sera 25 Jan, 2015 @ 8:26pm 
draw_self(); simply performs the basic function the Draw event would execute if you hadn't specified otherwise. It wouldn't have any effect on draw_sprite_ext();
Kihunter 30 Jan, 2015 @ 8:41pm 
I tried putting it in the Draw event, but it still doesn't work and my base sprite does not appear.
Thew 30 Jan, 2015 @ 9:52pm 
Do you have the x and y coords set right? It's possible it's being drawn off-screen. Can you post the exact code you're using?
Kihunter 1 Feb, 2015 @ 7:48am 
I'm 100% sure I have the coordinates right; when it's not the same as my player object, it's center-screen. Neither work. I am using a custom color variable, but even the built-in ones like c_yellow don't work either, so that can't be the issue.

The code is housed in the Step event currently, though I've tried the Create and Draw events as well.
Sera 1 Feb, 2015 @ 1:05pm 
Step event with any draw_ command will do nothing; the room's background color and anything else will all be drawn over it once the Draw event starts.

My only remaining idea is that maybe your depth values are a bit weird and something's being drawn over it, but you'd be having issues then even with just your basic object appearing.

Thre reason your base sprite wasn't appearing, consequently, is that the Draw event overwrites and object's default draw function (which is the previously mentioned draw_self()), so to keep that intact, just slap draw_self() at the start of the event and you should be fine.

Really not sure what's causing your problems here, though. Kinda baffled.
Tetr4roS 7 Feb, 2015 @ 8:53pm 
It definitely belongs in the Draw event- it won't do anything otherwise.
Like Zaron mentioned, the reason the sprite disapears when you've got the code in the Draw event is because when the Draw event has no code (by default), it just runs draw_self();
What's the color value you're using? The rest should work.
Kihunter 8 Feb, 2015 @ 8:50pm 
At this point, I've given up on this method and am now working around the issue. Decided to simply use objects to house the sprites and follow my player object.
Bream Freak 27 11 Feb, 2015 @ 3:43pm 
I am sure that method works correctly, just check the manual for your errors. (sorry for not doing this for you, quite late over here.)
Zerccies 22 Apr, 2024 @ 11:40pm 
hello i am almost a decade late to this discussion but i too have this unfixable problem, my normal draw_sprite works but the draw_sprite_ext acts like told to do their homework, nothing. i've tried anything to get it to work but honestly before in 2019 i had random unfixable draw event issues and of course im getting them again and i hate them.
last time i simply had to retype my code. there was no errors as i compared but it just wouldn't read it correctly

so i too will have to find work arounds, or exlore the other draw events and see if they work. all i wanted was to rotate the sprite in the draw event. nothing more
< >
Showing 1-11 of 11 comments
Per page: 1530 50