2014-03-10 14:04:58 +08:00
--------------------------------
-- @module Texture2D
2014-03-20 10:21:28 +08:00
-- @extend Ref
2014-06-25 17:36:50 +08:00
-- @parent_module cc
2014-03-18 15:55:30 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets max T.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getMaxT
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Returns the pixel format.<br>
2014-09-02 13:45:07 +08:00
-- since v2.0
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getStringForFormat
-- @param self
-- @return char#char ret (return value: char)
--------------------------------
2014-07-17 22:20:04 +08:00
-- @overload self, cc.Image, int
2014-07-17 10:28:34 +08:00
-- @overload self, cc.Image
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] initWithImage
-- @param self
-- @param #cc.Image image
2014-09-02 13:45:07 +08:00
-- @param #int format
2014-10-17 22:56:22 +08:00
-- @return bool#bool ret (return value: bool)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets max S.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getMaxS
-- @param self
-- @return float#float ret (return value: float)
2014-06-17 13:53:04 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Release only the gl texture.<br>
2014-09-02 13:45:07 +08:00
-- js NA<br>
-- lua NA
2014-06-17 13:53:04 +08:00
-- @function [parent=#Texture2D] releaseGLTexture
-- @param self
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-06-17 13:53:04 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Whether or not the texture has their Alpha premultiplied.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] hasPremultipliedAlpha
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets the height of the texture in pixels.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getPixelsHigh
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2014-07-17 22:20:04 +08:00
-- @overload self, int
2014-07-17 10:28:34 +08:00
-- @overload self
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getBitsPerPixelForFormat
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int format
2014-10-17 22:56:22 +08:00
-- @return unsigned int#unsigned int ret (return value: unsigned int)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets the texture name.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getName
-- @param self
-- @return unsigned int#unsigned int ret (return value: unsigned int)
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, char, cc.FontDefinition
2014-07-17 22:20:04 +08:00
-- @overload self, char, string, float, size_table, int, int
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] initWithString
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #char text
-- @param #string fontName
-- @param #float fontSize
-- @param #size_table dimensions
-- @param #int hAlignment
-- @param #int vAlignment
2014-10-17 22:56:22 +08:00
-- @return bool#bool ret (return value: bool)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Sets max T.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] setMaxT
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float maxT
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Draws a texture inside a rect.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] drawInRect
-- @param self
-- @param #rect_table rect
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Get the texture content size.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getContentSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Sets alias texture parameters:<br>
2014-09-02 13:45:07 +08:00
-- - GL_TEXTURE_MIN_FILTER = GL_NEAREST<br>
-- - GL_TEXTURE_MAG_FILTER = GL_NEAREST<br>
-- warning Calling this method could allocate additional texture memory.<br>
-- since v0.8
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] setAliasTexParameters
-- @param self
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Sets antialias texture parameters:<br>
2014-09-02 13:45:07 +08:00
-- - GL_TEXTURE_MIN_FILTER = GL_LINEAR<br>
-- - GL_TEXTURE_MAG_FILTER = GL_LINEAR<br>
-- warning Calling this method could allocate additional texture memory.<br>
-- since v0.8
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] setAntiAliasTexParameters
-- @param self
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Generates mipmap images for the texture.<br>
-- It only works if the texture size is POT (power of 2).<br>
-- since v0.99.0
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] generateMipmap
-- @param self
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Get texutre name, dimensions and coordinates message by a string.<br>
2014-09-02 13:45:07 +08:00
-- js NA<br>
-- lua NA
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getDescription
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets the pixel format of the texture.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getPixelFormat
-- @param self
2014-07-17 22:20:04 +08:00
-- @return int#int ret (return value: int)
2014-03-10 14:04:58 +08:00
2014-05-12 13:44:32 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Set a shader program to the texture.<br>
-- It's used by drawAtPoint and drawInRect
2014-05-12 13:44:32 +08:00
-- @function [parent=#Texture2D] setGLProgram
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.GLProgram program
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-05-12 13:44:32 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Get content size.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getContentSizeInPixels
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Gets the width of the texture in pixels.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getPixelsWide
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Drawing extensions to make it easy to draw basic quads using a Texture2D object.<br>
-- These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled.<br>
2015-03-24 11:25:31 +08:00
-- Draws a texture at a given point.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] drawAtPoint
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
2014-05-10 11:47:56 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Get a shader program from the texture.
2014-05-10 11:47:56 +08:00
-- @function [parent=#Texture2D] getGLProgram
-- @param self
-- @return GLProgram#GLProgram ret (return value: cc.GLProgram)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Whether or not the texture has mip maps.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] hasMipmaps
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2015-03-24 11:25:31 +08:00
-- Sets max S.
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] setMaxS
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float maxS
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-09-02 13:45:07 +08:00
--------------------------------
-- sets the default pixel format for UIImagescontains alpha channel.<br>
2015-03-24 11:25:31 +08:00
-- param format<br>
2014-09-02 13:45:07 +08:00
-- If the UIImage contains alpha channel, then the options are:<br>
-- - generate 32-bit textures: Texture2D::PixelFormat::RGBA8888 (default one)<br>
-- - generate 24-bit textures: Texture2D::PixelFormat::RGB888<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGBA4444<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGB5A1<br>
-- - generate 16-bit textures: Texture2D::PixelFormat::RGB565<br>
-- - generate 8-bit textures: Texture2D::PixelFormat::A8 (only use it if you use just 1 color)<br>
-- How does it work ?<br>
-- - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture)<br>
-- - If the image is an RGB (without Alpha) then: If the default pixel format is RGBA8888 then a RGBA8888 (32-bit) will be used. Otherwise a RGB565 (16-bit texture) will be used.<br>
-- This parameter is not valid for PVR / PVR.CCZ images.<br>
-- since v0.8
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] setDefaultAlphaPixelFormat
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int format
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-24 11:25:31 +08:00
-- Returns the alpha pixel format.<br>
2014-09-02 13:45:07 +08:00
-- since v0.8
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] getDefaultAlphaPixelFormat
-- @param self
2014-07-17 22:20:04 +08:00
-- @return int#int ret (return value: int)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- js ctor
2014-03-10 14:04:58 +08:00
-- @function [parent=#Texture2D] Texture2D
-- @param self
2015-01-21 17:33:26 +08:00
-- @return Texture2D#Texture2D self (return value: cc.Texture2D)
2014-03-10 14:04:58 +08:00
return nil