Sprite:get

From GiderosMobile
Revision as of 04:46, 7 July 2020 by MoKaLux (talk | contribs) (formatting)


Available since: Gideros 2011.6
Class: Sprite

Description

Returns the specified property of this sprite instance by its name. These names are supported:

  • "x"
  • "y"
  • "z"
  • "rotation"
  • "rotationX"
  • "rotationY"
  • "scaleX"
  • "scaleY"
  • "scaleZ"
  • "alpha"
  • "redMultiplier"
  • "greenMultiplier"
  • "blueMultiplier"
  • "alphaMultiplier"
  • "anchorX"
  • "anchorY"
  • "anchorZ"
(number) = Sprite:get(param)

Parameters

param: (string) the name of the parameter

Return values

Returns (number) the value of the parameter

Examples

Example

-- the following two lines do the same thing
x = sprite:getX()
x = sprite:get("x")
	
-- the following two lines do the same thing
y = sprite:getY()
y = sprite:get("y")

-- the following two lines do the same thing
rotation = sprite:getRotation()
rotation = sprite:get("rotation")

-- the following two lines do the same thing
scaleX = sprite:getScaleX()
scaleX = sprite:get("scaleX")

-- the following two lines do the same thing
scaleY = sprite:getScaleY()
scaleY = sprite:get("scaleY")