|
SpriteDrawMode | |
SpriteDrawMode SpriteIndex, DrawMode | |
Parameters: SpriteIndex = The identifier of the sprite you wish to alter of the Draw Mode of DrawMode = The Draw Modes flag for this sprite |
|
Returns: NONE | |
SpriteDrawMode sets the sprites draw mode property. This effects how PlayBASIC will render this sprite. You have a number different effects modes to choose from. Moreover most effects can be combined with Rotation, Scaling, Tinting, Filtering and Alpha Channels also. Available Draw Mode Values
Note: We highly recommended you read the Images tutorials BlitMode FACTS: * Sprite Image is drawn as is. Rotation, Scaling have no affect upon the image. Rotation Mode FACTS: * By default rotation occurs around the images top left hand corner (0x,0y). If you want it to be centered use the SpriteHandle, CenterSpriteHandle or AutoCenterSpriteHandle commands * Rotation mode also activates sprite scaling. Use the ScaleSprite,ScaleSpriteXY etc controls the size. * Alpha Mode requires the sprites image to be stored either FX or AFX format. PrepareFXImage, LoadFxImage, NewFxIMage Alpha Mode FACTS: * Variable Alpha Blends between then source image and the current drawing surface. Use the SpriteAlphaLevel command to control the blending level. * When SpriteAlphaLevel is set to the zero, then sprite is not drawn at all. * When SpriteAlphaLevel is set to the one or above, then sprite is not drawn using alpha, but BlitMode for better speed. * Alpha Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Alpha Blending directly to video memory can be a very slow process. It should be used sparingly! Alpha Blend 50/50 FACTS: * Alpha Blend the source image and the current drawing surface. The two are merged with an equal amount of each. It's the same as using Alpha Blend mode above with a blend level of 0.5, except this version is faster. * Alpha Mode requires the sprites image to be stored either FX or AFX format. PrepareFXImage, LoadFxImage, NewFxIMage * Alpha Blending directly to video memory can be a very slow process. It should be used sparingly Alpha Addition FACTS: * Alpha Addition take each pixel in the source image and adds them with the backdrop. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Alpha Blending directly to video memory can be a very slow process. It should be used sparingly * Only works in conjunction with rotated mode. Alpha Subtraction FACTS: * Alpha Subtraction take each pixel in the source image and subtracts them with the backdrop. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Alpha Blending directly to video memory can be a very slow process. It should be used sparingly * Only works in conjunction with rotated mode. Fade FACTS: * Fade allows each pixel in the sprite to uniformly faded before rendering. The level can be controlled using the SpriteFadeLevel command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Gouraud Fade FACTS: * Gouraud Fade allows each pixel in the sprite to faded before rendering. The fade level of each pixel is determined via gouraud shading the sprite vertex colour levels. The vertex colours of each corner of the sprite can be set using the SpriteImageRGB command. The new colour is computed by Multiplying the Gouraud pixel with the image pixels. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. RGB Gouraud 50/50 Alpha Blend FACTS: * RGB Gouraud 50/50 Blend, alpha blends each pixel in the sprites image with a gouraud shaded RGB value. The pixels are merged together before rendering You can control the gouraud RGB values at each corner (vertex) on the sprite using the SpriteImageRGB command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. RGB Gouraud Alpha ADD FACTS: * RGB Gouraud Alpha Add, adds each pixel in the sprites image with a corresponding gouraud shaded RGB value. The pixels are merged together before rendering You can control the gouraud RGB values at each corner (vertex) on the sprite using the SpriteImageRGB command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Flash FACTS: * Colour Flash will replace all none transparent pixels in the sprite with the flash colour. You can set the flash colour using the SpriteFlashColour command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Alpha FACTS: * Colour Alpha allows you to apply a variable alpha blend between the sprites pixels and set colour. The blend colour is set using the SpriteAlphaColour command and level of blending is controlled using the SpriteAlphaLevel command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Add FACTS: * Colour Add mode performs a fixed alpha addition between colour value to the sprites pixels before drawing. The blend colour is set using the SpriteAlphaAddColour command. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Sub FACTS: * Colour Sub mode performs a fixed alpha subtraction between the sprites alpha subtraction colour value and all sprites pixels before drawing. The subtraction colour is set using the SpriteAlphaSubColour command. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Replace FACTS: * Colour Replace mode will replace a user defined colour in the sprites image with a alternative colour while drawing. The alternative colour is set using the SpriteReplacementColour command and the colour key is set using the SpriteColourReplaceKey command. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Raster Bar Colour Replace FACTS: * Raster Bar Colour Replace mode will replace a user defined colour in the sprites image with a alternative colour from a colour buffer before drawing. The colour buffer is applied to the y axis of the screen as the sprite is rendered. So each horizontal scan line (raster) can have an alternative replacement colour. This lets you run raster bars through sprites dynamically. You can set the colour buffer array using the SpriteRasterColourBuffer command and the colour key is set using the SpriteColourReplaceKey command. * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Mask Logical AND - FACTS * Colour Mask Logical AND mode will perform a logical AND operation between the sprites ColourFlash colour and all pixels in the sprite. You can set the flash colour using the SpriteFlashColour command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. Colour Mask Logical OR - FACTS * Colour Mask Logical OR mode will perform a logical OR operation between the sprites ColourFlash colour and all none transparent pixels in the sprite. You can set the flash colour using the SpriteFlashColour command * This Mode requires the sprites image to be stored in FX format. PrepareFXImage, LoadFxImage, NewFxIMage * Only works in conjunction with rotated mode. |
|
Example Source: Download This Example
|
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |