GameMaker: Studio

GameMaker: Studio

Преглед на статистиките:
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?
< >
Показване на 1-11 от 11 коментара
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?
and maybe add the line: draw_self(); before the draw_sprite_ext
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();
I tried putting it in the Draw event, but it still doesn't work and my base sprite does not appear.
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?
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.
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.
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.
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.
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.)
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
< >
Показване на 1-11 от 11 коментара
На страница: 1530 50