Skip to content

BaseClass

Uladzislau Nikalayevich edited this page Mar 3, 2020 · 4 revisions

Values

{
    x = 0, y = 0, -- float, float  position on current render target
    w = 8, h = 8, -- float, float width, height
    p = 1,        -- integer layer
    stats = {
    }
    statusSounds = {
    }
} 

Methods

subclass

table newClass = dxGUI.baseClass:subclass( table newClass )
table anotherObject = newClass:subclass( table AnotherNewClass )

setPosition

bool status = object:setPosition( float absoluteX, float absoluteY )

getPosition

float x, float y = object:getPosition( )

setSize

bool status = object:setSize( float width, float height )

getSize

float width, float height = object:getSize( )

setShow

bool status = object:setShow( bool state )

isShow

bool status = object:isShow( )

isOnCursor

bool status = object:isOnCursor( )

setColor

bool status = object:setColor( integer red, integer green, integer blue [, integer alpha = 255 ])
bool status = object:setColor( integer color )

Examples:

object:setColor( 255, 0, 255, 100 )
object:setColor( 0x64FF00FF ) -- is same

getColor

return hex color 0xAARRGGBB AA - alpha, RR - red, GG - green, BB - blue

integer color = object:getColor( )

setAlpha set alpha (0-255)

bool status = object:setAlpha( float alpha )

getAlpha

integer alpha = object:getAlpha( )

setPostGUI

bool status = object:setPostGUI( bool state )

getPostGUI

bool status = object:getPostGUI()

addAnim

table anim_instance = object:addAnim( anim anim [, var var_1, var var_2, ... )

Example:

local anim = Anim.find( 'animname' )
local loadedAnimInstance = object:addAnim( anim, 1000, false )

removeAnim

bool status = object:removeAnim( integer index [, string reason ] )

updateAnims -- e

void object:updateAnims()