TextureBase: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
<languages />
<!-- GIDEROSOBJ:TextureBase -->
<!-- GIDEROSOBJ:TextureBase -->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/>
'''Inherits from:''' [[Object]]<br/>


=== <translate>Description</translate> ===
=== Description ===
[[Special:MyLanguage/TextureBase|TextureBase]] is the base class for [[Special:MyLanguage/Texture|Texture]] and [[Special:MyLanguage/TexturePack|TexturePack]] classes. It provides a common functionaly to texture related classes.
TextureBase is the base class for [[Texture]] and [[TexturePack]] classes. It provides a common functionaly to texture related classes.


*TextureBase.CLAMP = "clamp"
*TextureBase.CLAMP = "clamp"
*TextureBase.REPEAT = "repeat"
*TextureBase.REPEAT = "repeat"
==== '''formats''' ====
Transparency (Alpha) support:
*'''TextureBase.A8''': ''alpha'', ''bbp'': 8 bits (1 byte), ''no colors'' (Alpha only). For pure transparency masks, fading effects, or solid-color shapes that only need opacity control
*'''TextureBase.YA8''': ''alpha'', ''bbp'': 16 bits (2 bytes), ''no colors'' (Grayscale + Alpha). For Grayscale images that require transparency (e.g., UI icons, fonts)
*'''TextureBase.RGBA4444''': ''alpha'', ''bbp'': 16 bits (2 bytes), ''colors'' (Low color). For low-detail color images where dithering or color banding is acceptable
*'''TextureBase.RGBA5551''': ''alpha'', ''bbp'': 16 bits (2 bytes), ''colors'' (Low color). For color images where pixels are either 100% visible or 100% invisible (no partial transparency)
*'''TextureBase.RGBA8888''': ''alpha'', ''bbp'': 32 bits (4 bytes), ''colors'' (Full color). For high-quality, full-color images with smooth, semi-transparent gradients
No transparency (Alpha) support, will render a solid background:
*'''TextureBase.Y8''': ''no alpha'', ''bbp'': 8 bits (1 byte), ''no colors'' (Grayscale). For Grayscale images that don't require transparency
*'''TextureBase.RGB565''': ''no alpha'', ''bbp'': 16 bits (2 bytes), ''colors'' (Low color). For color images with no transparency
*'''TextureBase.RGB888''': ''no alpha'', ''bbp'': 24 bits (3 bytes), ''colors'' (Full color). For high-quality, full-color images with no transparency
''bbp'' = Bits per Pixel


{|-
{|-
| style="width: 50%; vertical-align:top;"|
| style="width: 50%; vertical-align:top;"|
=== <translate>Methods</translate> ===
=== Methods ===
[[Special:MyLanguage/TextureBase:getHeight|TextureBase:getHeight]] ''<translate>returns the height of the texture in pixels</translate>''<br/><!-- GIDEROSMTD:TextureBase:getHeight() returns the height of the texture in pixels -->
[[TextureBase:getHeight]] ''returns the height of the texture in pixels''<br/><!--GIDEROSMTD:TextureBase:getHeight() returns the height of the texture in pixels-->
[[Special:MyLanguage/TextureBase:getWidth|TextureBase:getWidth]] ''<translate>returns the width of the texture in pixels</translate>''<br/><!-- GIDEROSMTD:TextureBase:getWidth() returns the width of the texture in pixels -->
[[TextureBase:getSize]] ''returns the size of a texture''<br/><!--GIDEROSMTD:TextureBase:getSize() returns the size of a texture-->
[[TextureBase:getTexelSize]] ''returns the size of a texel''<br/><!--GIDEROSMTD:TextureBase:getTexelSize() returns the size of a texel, 1/(gpu texture width), 1/(gpu texture height)-->
[[TextureBase:getWidth]] ''returns the width of the texture in pixels''<br/><!--GIDEROSMTD:TextureBase:getWidth() returns the width of the texture in pixels-->
[[TextureBase:update]] ''changes an existing texture content''<br/><!--GIDEROSMTD:TextureBase:update(pixels,width,height) changes an existing texture content-->


| style="width: 50%; vertical-align:top;"|
| style="width: 50%; vertical-align:top;"|
=== <translate>Events</translate> ===
 
=== <translate>Constants</translate> ===
=== Events ===
[[Special:MyLanguage/TextureBase.CLAMP|TextureBase.CLAMP]]<br/><!-- GIDEROSCST:TextureBase.CLAMP clamp-->
=== Constants ===
[[Special:MyLanguage/TextureBase.REPEAT|TextureBase.REPEAT]]<br/><!-- GIDEROSCST:TextureBase.REPEAT repeat-->
[[TextureBase.CLAMP]]<br/><!--GIDEROSCST:TextureBase.CLAMP clamp-->
[[Special:MyLanguage/TextureBase.RGB565|TextureBase.RGB565]]<br/><!-- GIDEROSCST:TextureBase.RGB565 rgb565-->
[[TextureBase.REPEAT]]<br/><!--GIDEROSCST:TextureBase.REPEAT repeat-->
[[Special:MyLanguage/TextureBase.RGB888|TextureBase.RGB888]]<br/><!-- GIDEROSCST:TextureBase.RGB888 rgb888-->
[[TextureBase.RGB565]]<br/><!--GIDEROSCST:TextureBase.RGB565 rgb565-->
[[Special:MyLanguage/TextureBase.RGBA4444|TextureBase.RGBA4444]]<br/><!-- GIDEROSCST:TextureBase.RGBA4444 rgba4444-->
[[TextureBase.RGB888]]<br/><!--GIDEROSCST:TextureBase.RGB888 rgb888-->
[[Special:MyLanguage/TextureBase.RGBA5551|TextureBase.RGBA5551]]<br/><!-- GIDEROSCST:TextureBase.RGBA5551 rgba5551-->
[[TextureBase.RGBA4444]]<br/><!--GIDEROSCST:TextureBase.RGBA4444 rgba4444-->
[[Special:MyLanguage/TextureBase.RGBA8888|TextureBase.RGBA8888]]<br/><!-- GIDEROSCST:TextureBase.RGBA8888 rgba8888-->
[[TextureBase.RGBA5551]]<br/><!--GIDEROSCST:TextureBase.RGBA5551 rgba5551-->
[[TextureBase.RGBA8888]]<br/><!--GIDEROSCST:TextureBase.RGBA8888 rgba8888-->
[[TextureBase.Y8]]<br/><!--GIDEROSCST:TextureBase.Y8 y8-->
[[TextureBase.A8]]<br/><!--GIDEROSCST:TextureBase.A8 a8-->
[[TextureBase.YA8]]<br/><!--GIDEROSCST:TextureBase.YA8 ya8-->
|}
|}
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 01:20, 27 September 2026

Supported platforms:
Available since: Gideros 2011.6
Inherits from: Object

Description

TextureBase is the base class for Texture and TexturePack classes. It provides a common functionaly to texture related classes.

  • TextureBase.CLAMP = "clamp"
  • TextureBase.REPEAT = "repeat"

formats

Transparency (Alpha) support:

  • TextureBase.A8: alpha, bbp: 8 bits (1 byte), no colors (Alpha only). For pure transparency masks, fading effects, or solid-color shapes that only need opacity control
  • TextureBase.YA8: alpha, bbp: 16 bits (2 bytes), no colors (Grayscale + Alpha). For Grayscale images that require transparency (e.g., UI icons, fonts)
  • TextureBase.RGBA4444: alpha, bbp: 16 bits (2 bytes), colors (Low color). For low-detail color images where dithering or color banding is acceptable
  • TextureBase.RGBA5551: alpha, bbp: 16 bits (2 bytes), colors (Low color). For color images where pixels are either 100% visible or 100% invisible (no partial transparency)
  • TextureBase.RGBA8888: alpha, bbp: 32 bits (4 bytes), colors (Full color). For high-quality, full-color images with smooth, semi-transparent gradients

No transparency (Alpha) support, will render a solid background:

  • TextureBase.Y8: no alpha, bbp: 8 bits (1 byte), no colors (Grayscale). For Grayscale images that don't require transparency
  • TextureBase.RGB565: no alpha, bbp: 16 bits (2 bytes), colors (Low color). For color images with no transparency
  • TextureBase.RGB888: no alpha, bbp: 24 bits (3 bytes), colors (Full color). For high-quality, full-color images with no transparency
bbp = Bits per Pixel

Methods

TextureBase:getHeight returns the height of the texture in pixels
TextureBase:getSize returns the size of a texture
TextureBase:getTexelSize returns the size of a texel
TextureBase:getWidth returns the width of the texture in pixels
TextureBase:update changes an existing texture content

Events

Constants

TextureBase.CLAMP
TextureBase.REPEAT
TextureBase.RGB565
TextureBase.RGB888
TextureBase.RGBA4444
TextureBase.RGBA5551
TextureBase.RGBA8888
TextureBase.Y8
TextureBase.A8
TextureBase.YA8