View Single Post
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Jul 10, 2015, 09:38 PM
Violet CLM is offline
Reply With Quote
Really, you should be asking that in the AngelScript help thread, but...
Quote:
Originally Posted by Kurisuchan_79 View Post
VioletCLM, you are magic!
...how can I resist?


JJ2+ ships with a whole bunch of sprite modes, used for drawing sprites with different colors and/or transparencies. The easiest way to try them out is a simple script like this:
Code:
void onLevelBegin() {
	jjLocalPlayers[0].spriteMode = SPRITE::NEONGLOW;
}
Probably more often, though, you want to be drawing sprites that are not the player's, so you want one of the many sprite-drawing functions. For example:
Code:
void onPlayer(jjPLAYER@ play) {
	jjDrawSprite(
		play.xPos + 30, //horizontal position to draw at, relative to the top left corner of the level (not the screen)
		play.yPos, //vertical position to draw at
		ANIM::AMMO, //animation set to find the desired frame from
		18, //number of the desired animation within the animation set, zero-indexed
		0, //number of the desired frame within the animation, zero-indexed 
		SPRITE::FLIPNONE, //direction (not flipped horizontally OR vertically)
		SPRITE::TINTED, //a sprite mode
		jjGameTicks //a parameter used by the sprite mode, in this case, which color (index in the palette) to use for tinting the sprite
	);
}
There are a lot of different functions for drawing stuff to the screen, and a lot of sprite modes to use while doing so, and the best way to familiarize yourself with them all is to experiment. Also to look at the example levels, and the snippets, various other scripts. Ideally a mixture of both.

The "black & white circle" specifically shouldn't look like that: you're viewing it in 8-bit color, which has a hard time displaying several of the sprite modes. (In that screenshot it kind of comes out like thresholding, but there's not actually a built-in way to do that, sorry.) It's supposed to be (and is, in 16-bit color) a negative image effect, which you can get by drawing all-white pixels with mode SPRITE::DIFFERENCE.
__________________