Function _IrrDraw2DImageElement

au3Irr2

au3Irr2 Function Reference

_IrrDraw2DImageElement

Draws given rectangular section from a texture to the display at the supplied coordinates

#Include <au3Irrlicht2.au3>
_IrrDraw2DImageElement($h_Texture, $i_XPos, $i_YPos, $i_SourceTopX, $i_SourceTopY, $i_SourceBottomX, $i_SourceBottomY, $i_UseAlpha)

 

Parameters

$h_Image Handle to an irrlicht image object
$i_XPos X position on display from where drawing starts
$i_YPos Y position on display from where drawing starts
$i_SourceTopX X top position of rectangle in the source texture
$i_SourceTopY Y top position of rectangle in the source texture
$i_SourceBottomX X bottom position of rectangle in the source texture
$i_SourceBottomY Y bottom position of rectangle in the source texture
$i_UseAlpha Whether or not to use the alpha channel should be one of the following values:
$IRR_IGNORE_ALPHA
$IRR_USE_ALPHA

 

Return Value

Success: True
Failure: False

 

Remarks

Draws the texture to the display at the supplied co-ordinates, the image is copied from the specified rectangle in the source texture, this enables you to put many images onto a single texture.
This function also supports the alpha channel when drawing the image to the display and can draw the image transparently.

 

Related

_IrrGetTexture, _IrrColorKeyTexture, _IrrDraw2DImage, _IrrDraw2DImageElementStretch

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $logo = _IrrGetTexture("./media/cross.bmp")
_IrrColorKeyTexture($logo, 255, 255, 255)

WHILE _IrrRunning()
    _IrrBeginScene(50, 0, 0)
    _IrrDraw2DImageElement( $logo, 0, 0 , 0, 0, 128, 64, $IRR_IGNORE_ALPHA)
    _IrrDraw2DImageElement( $logo, 0, 64, 0, 64, 128, 128, $IRR_USE_ALPHA)
    _IrrEndScene()
WEND

_IrrStop()