The displayed height of this Game Object.
This value takes into account the scale factor.
Setting this value will adjust the Game Object's scale property.
The displayed width of this Game Object.
This value takes into account the scale factor.
Setting this value will adjust the Game Object's scale property.
The native (un-scaled) height of this Game Object.
Changing this value will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or use
the displayHeight property.
The native (un-scaled) width of this Game Object.
Changing this value will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or use
the displayWidth property.
Sets the display (rendered) size of this Game Object in pixels.
Unlike setSize, which changes the native logical dimensions without affecting rendering,
this method adjusts the scaleX and scaleY properties so that the Game Object appears
at exactly the given pixel dimensions in-game. It is equivalent to calculating and setting
the scale manually, but more convenient when you want to work in pixel values directly.
The width of this Game Object.
The height of this Game Object.
This Game Object instance.
Sets the internal size of this Game Object, as used for frame or physics body creation.
This will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or call the
setDisplaySize method, which is the same thing as changing the scale but allows you
to do so by giving pixel values.
If you have enabled this Game Object for input, changing the size will not change the
size of the hit area. To do this you should adjust the input.hitArea object directly.
The width of this Game Object.
The height of this Game Object.
This Game Object instance.
Sets the size of this Game Object to be that of the given Frame or the current Frame.
This will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or call the
setDisplaySize method, which is the same thing as changing the scale but allows you
to do so by giving pixel values.
If you have enabled this Game Object for input with a custom hit area, changing the size of the Game Object will not change the
size of the hit area. If you wish to do this, you should adjust the input.hitArea object directly.
If you have enabled this Game Object for input without a custom hit area, the hit area will be automatically resized to match the size of the selected Frame.
Optionalframe: Frame
The frame to base the size of this Game Object on. The default is the current frame of the Game Object.
This Game Object instance.
Provides methods used for getting and setting the size of a Game Object.
This component distinguishes between two size concepts. The native size (
widthandheight) is the un-scaled logical size, typically derived from the Game Object's texture frame. The display size (displayWidthanddisplayHeight) is the actual rendered size in pixels, which factors in the Game Object's scale. Setting the display size adjusts the scale automatically, while setting the native size does not affect rendering directly.This component is mixed into Game Objects such as Sprites and Images by the Phaser Game Object Factory and is not intended to be used standalone.