Class ccui.ImageView

Class Summary
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

  • <static> {ccui.ImageView} ccui.ImageView.create(imageFileName, texType)
    Allocates and initializes a UIImageView.
    // example
    var uiImageView = ccui.ImageView.create();
    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
  • setScale9Enabled(able)
    Sets if button is using scale9 renderer.
    Parameters:
    {Boolean} able
  • setTextureRect(rect)
    Sets texture rect
    Parameters:
    {cc.Rect} rect