rigz.max2dext: | Functions | Modinfo | Source |
Max2D module provides a few extra features for the standard max2d, mainly the loading of images in PreMultipliedAlpha mode which enables and additional blend mode - screen blend, plus making it a lot easier to grab a screen with the lpaha channel intact.
In order to use this properly for your own use (this is mainly for use internally by timelinefx you need to follow a few rules:
GetBlendEXT | get the current Blend Mode of SetBlendEXT. |
GrabPixmapEXT | Grab pixmap. |
InitEXTGraphics | Initialise the Extended Graphics Driver. |
LoadAnimImageEXT | Load a multi-frame image. |
LoadImageEXT | Load an image. |
SetAlphaEXT | Set current alpha level. |
SetBlendEXT | Set current blend mode. |
SetClsColorEXT | Reset the state_blend of the normal SetBlend command. |
SetColorEXT | Set current color. |
Function GetBlendEXT:Int() | |
Returns | the current blendmode. |
Description | get the current Blend Mode of SetBlendEXT. |
Function GrabPixmapEXT:TPixmap(x:Int, y:Int, width:Int, height:Int) | |
Description | Grab pixmap. |
Function InitEXTGraphics() | |
Description | Initialise the Extended Graphics Driver. |
Information | It's important that you run this before attemtping to use any of the EXT commands. |
Function LoadAnimImageEXT:TImage(url:Object, cell_width:Int, cell_height:Int, first_cell:Int, cell_count:Int, flags:Int = -1, PreMultiAlpha:Int = False) | |
Returns | An image object. |
Description | Load a multi-frame image. |
Information | This will load an animation image and pre multiply all it's colour with the alpha channel PreMultiAlpha is set to true. |
Function LoadImageEXT:TImage(url:Object, flags:Int = -1, ChangeImage:TPixmap(pixmap:TPixmap)) | |
Returns | A new image object. |
Description | Load an image. |
Information | This will load an image and pre multiply all it's colour with the alpha channel if PreMultiAlpha is set to True. |
Function SetAlphaEXT(alpha:Float) | |
Description | Set current alpha level. |
Information | Use this when working with images that have premultiplied alpha
alpha should be in the range 0 to 1.
alpha controls the transparancy level when the ALPHABLEND blend mode is in effect. The range from 0.0 to 1.0 allows a range of transparancy from completely transparent to completely solid. |
Function SetBlendEXT(blend:Int) | |||||||||||||||
Description | Set current blend mode. | ||||||||||||||
Information | SetBlend controls how pixels are combined with existing pixels in the back buffer when drawing
commands are used in BlitzMax.
blend should be one of:
|
Function SetClsColorEXT(red:Int, green:Int, blue:Int, alpha:Float = 1) | |
Description | Reset the state_blend of the normal SetBlend command. |
Information | After using SetBlendEXT, Max2d won't know whether it's blendmode is the same anymore, so use this to reset it and ensure it works properly
next time you use it.
end rem
Function ResetBlendMode()
SetBlend 10
SetBlend GetBlend()
End Function
rem bbdoc: Reset the state_blend of the SetBlendEXT command about: After using SetBlend, Max2dEXT won't know whether it's blendmode is the same anymore, so use this to reset it and ensure it works properly next time you use it. end rem Function ResetBlendModeEXT() SetBlendEXT 10 SetBlend GetBlendEXT() End Function Rem bbdoc: Set current Cls color plus the alpha level about: The red, green and blue parameters should be in the range of 0 to 255. Alpha should be in the range 0 to 1. The default cls color is black. |
Function SetColorEXT(red:Int, green:Int, blue:Int) | |
Description | Set current color. |
Information | Use this when working with images that have premultiplied alpha
The red, green and blue parameters should be in the range of 0 to 255. |
Version | 1 |
---|---|
Author | Peter Rigby |
License | MIT |
Copyright | RigzSoft |