Class: ImageLayer

me. ImageLayer

new ImageLayer(x, y, settings)

a generic Image Layer Object
Parameters:
Name Type Description
x Number x coordinate
y Number y coordinate
settings Object ImageLayer properties
Properties
Name Type Argument Default Description
image Image | String Image reference. See me.loader.getImage
name String <optional>
"me.ImageLayer" Layer name
z Number <optional>
0 z-index position
ratio Number | me.Vector2d <optional>
1.0 Scrolling ratio to be applied
anchorPoint Number | me.Vector2d <optional>
0.0 Image origin. See me.ImageLayer#anchorPoint
Source:
TMXLayer.js, line 82

Extends

Members

alpha :Number

Define the renderable opacity
Set to zero if you do not wish an object to be drawn
Type:
  • Number
Inherited From:
Default Value:
  • 1.0
Source:
renderable.js, line 151
See:
  • me.Renderable#setOpacity
  • me.Renderable#getOpacity

ancestor :me.Container

a reference to the Container object that contains this renderable, or undefined if it has not been added to one.
Type:
Inherited From:
Default Value:
  • undefined
Source:
renderable.js, line 163

anchorPoint :me.Vector2d

Define how the image is anchored to the viewport bounds
By default, its upper-left corner is anchored to the viewport bounds upper left corner.
The anchorPoint is a unit vector where each component falls in range [0.0,1.0].
Some common examples:
* <0.0,0.0> : (Default) Anchor image to the upper-left corner of viewport bounds * <0.5,0.5> : Center the image within viewport bounds * <1.0,1.0> : Anchor image to the lower-right corner of viewport bounds To specify a value through Tiled, use one of the following format :
- a number, to change the value for both axis
- a json expression like `json:{"x":0.5,"y":0.5}` if you wish to specify a different value for both x and y
Type:
Default Value:
  • <0.0,0.0>
Source:
TMXLayer.js, line 141

ratio :me.Vector2d

Define the image scrolling ratio
Scrolling speed is defined by multiplying the viewport delta position (e.g. followed entity) by the specified ratio. Setting this vector to <0.0,0.0> will disable automatic scrolling.
To specify a value through Tiled, use one of the following format :
- a number, to change the value for both axis
- a json expression like `json:{"x":0.5,"y":0.5}` if you wish to specify a different value for both x and y
Type:
Default Value:
  • <1.0,1.0>
Source:
TMXLayer.js, line 117

repeat :String

Define if and how an Image Layer should be repeated.
By default, an Image Layer is repeated both vertically and horizontally.
Acceptable values :
* 'repeat' - The background image will be repeated both vertically and horizontally. (default)
* 'repeat-x' - The background image will be repeated only horizontally.
* 'repeat-y' - The background image will be repeated only vertically.
* 'no-repeat' - The background-image will not be repeated.
Type:
  • String
Source:
TMXLayer.js, line 168

Methods

<static> resize(w, h)

resize the Image Layer to match the given size
Parameters:
Name Type Description
w Number new width
h Number new height
Source:
TMXLayer.js, line 236
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:40+08:00 using the DocStrap template modified by codename-.