Difference between revisions of "Bitmap:setAnchorPoint"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
 +
<translate><br />
 +
Sets the anchor point of [[[Bitmap]]] object. <br />
 
<br />
 
<br />
Sets the anchor point of `Bitmap` object. <br />
+
Each [[[Bitmap]]] object has an anchor point that affects the positioning of the texture displayed. By modifying the anchor point, you change the origin of the texture. For example, setting the anchor point to (0.5, 0.5) moves the center of the texture to the origin. If you set the anchor point to (1, 1) instead, the bottom-right corner of the texture will be the origin. The default value of anchor point is (0, 0) which means top-left of the texture is the origin by default.<br />
<br />
+
<br /></translate>
Each `Bitmap` object has an anchor point that affects the positioning of the texture displayed. By modifying the anchor point, you change the origin of the texture. For example, setting the anchor point to (0.5, 0.5) moves the center of the texture to the origin. If you set the anchor point to (1, 1) instead, the bottom-right corner of the texture will be the origin. The default value of anchor point is (0, 0) which means top-left of the texture is the origin by default.<br />
 
<br />
 
 
<source lang="lua">
 
<source lang="lua">
 
  Bitmap:setAnchorPoint(x,y)
 
  Bitmap:setAnchorPoint(x,y)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''x''': (number) The x coordinate of anchor point. Usually between [0, 1]. <br/>
+
'''x''': (number) <translate>The x coordinate of anchor point. Usually between [0, 1].</translate> <br/>
'''y''': (number) The y coordinate of anchor point. Usually between [0, 1]. <br/>
+
'''y''': (number) <translate>The y coordinate of anchor point. Usually between [0, 1].</translate> <br/>

Revision as of 13:32, 23 August 2018

Available since: Gideros 2011.6

Description


Sets the anchor point of [[[Bitmap]]] object.

Each [[[Bitmap]]] object has an anchor point that affects the positioning of the texture displayed. By modifying the anchor point, you change the origin of the texture. For example, setting the anchor point to (0.5, 0.5) moves the center of the texture to the origin. If you set the anchor point to (1, 1) instead, the bottom-right corner of the texture will be the origin. The default value of anchor point is (0, 0) which means top-left of the texture is the origin by default.

 Bitmap:setAnchorPoint(x,y)

Parameters

x: (number) The x coordinate of anchor point. Usually between [0, 1].
y: (number) The y coordinate of anchor point. Usually between [0, 1].