Setdrawmethod quirks

CRxTRDude

Member
Picked up from the "bug with shadow trails" post ...

Story so far:



Checked the problem now and I think I knew why it does.

For others out there, is there a way to improve the shadow trailer code or better yet, isolate setdrawmethods for it?

Apparently, it uses NULL() as the entity for setdrawmethod and it's screwing up other scripts that uses NULL() as well. That's why it screwed up as the shadow trailer setdrawmethod carries over the color map for the shadow trail onto entities that should not use the colormap in the first place (like sprites for dialogue).

BTW, how do you guys read/interpret this:

Code:
setdrawmethod(NULL(),1,sx,sy,facing,0,0,6,0,0,0,0,0,map);

A lot of extra parameters than I used to.



Also, is this description for setdrawmethod still correct for global drawmethod?:

setdrawmethod(entity, int flag, int scalex, int scaley, int flipx, int flipy, int shiftx, int alpha, int colourmap, int fillcolour, int rotate, int rotateflip, int transparencybg)
 
Two things:

First, Setdrawmethod is outdated. It's been replaced with changedrawmethod(<entity/screen>, <property>, <value>). I despise the naming convention of "change" instead of "set", but otherwise the new way is far more useful as it allows you to set one property at a time. See my Tech Demo - Color Tinting for a working example.

Now as for shadow trails and other uses of global drawmethod, OpenBOR has a built in method to support multiple global drawing effects: Screens. The use of them goes beyond the scope of my post here, but basically, screens let you divide up the global display into work layers (think masks in Photoshop). Then you can use drawmethods, drawsprites, or whatever else to your heart's content - settings in one screen won't interfere with the other.

It just so happens that the example code most authors use for shadow trails doesn't bother with screens, nor do most global effects, because it usually isn't a problem. But if you want more than one in place at a time, you need to learn screens.

DC
 
I knew it. *snap* It does say in the script code that setdrawmethod's deprecated.

Where do I start with the screens and how it works? It wasn't as extensively covered in here and others as well.
 
Back
Top Bottom