Class ccui.ImageView
- Defined in: UIImageView.js
- Extends ccui.Widget
Constructor Attributes | Constructor Name and Description |
---|---|
The ImageView control of Cocos GUI
|
Method Summary
Class Detail
ccui.ImageView()
The ImageView control of Cocos GUI
Field Detail
<static> <constant>
ccui.ImageView.RENDERER_ZORDER
The zOrder value of ccui.ImageView's renderer.
Method Detail
-
Allocates and initializes a UIImageView.
- Parameters:
- {string} imageFileName
- {Number} texType
- Deprecated:
- since v3.0, please use new ccui.ImageView() instead.
- Returns:
- {ccui.ImageView}
-
ctor(imageFileName, texType)allocates and initializes a ccui.ImageView. Constructor of ccui.ImageView, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
// example var uiImageView = new ccui.ImageView;
- Parameters:
- {String} imageFileName
- {Number} texType Optional, Default: =ccui.Widget.LOCAL_TEXTURE
-
{cc.Rect} getCapInsets()Returns cap insets of ccui.ImageView.
- Returns:
- {cc.Rect}
-
{string} getDescription()Returns the "class name" of ccui.ImageView.
- Returns:
- {string}
-
{cc.Node} getVirtualRenderer()Returns the renderer of ccui.ImageView
- Returns:
- {cc.Node}
-
{cc.Size} getVirtualRendererSize()Returns the image's texture size.
- Returns:
- {cc.Size}
-
ignoreContentAdaptWithSize(ignore)Ignore the imageView's custom size, true that imageView will ignore it's custom size, use renderer's content size, false otherwise.
- Parameters:
- {Boolean} ignore
-
{boolean} init(imageFileName, texType)Initializes an imageView. please do not call this function by yourself, you should pass the parameters to constructor to initialize it.
- Parameters:
- {String} imageFileName
- {Number} texType Optional, Default: =ccui.Widget.LOCAL_TEXTURE
- Returns:
- {boolean}
-
{Boolean} isScale9Enabled()Returns ImageView is using scale9 renderer or not.
- Returns:
- {Boolean}
-
loadTexture(fileName, texType)Loads textures for button.
- Parameters:
- {String} fileName
- {ccui.Widget.LOCAL_TEXTURE|ccui.Widget.PLIST_TEXTURE} texType
-
setCapInsets(capInsets)Sets capinsets for button, if button is using scale9 renderer.
- Parameters:
- {cc.Rect} capInsets
-
setContentSize(contentSize, height)Sets _customSize of ccui.Widget, if ignoreSize is true, the content size is its renderer's contentSize, otherwise the content size is parameter. and updates size percent by parent content size. At last, updates its children's size and position.
- Parameters:
- {cc.Size|Number} contentSize
- content size or width of content size
- {Number} height Optional
-
setScale9Enabled(able)Sets if button is using scale9 renderer.
- Parameters:
- {Boolean} able
-
setTextureRect(rect)Sets texture rect
- Parameters:
- {cc.Rect} rect