Documentation
¶
Overview ¶
Package PortableCompressedTexture2D provides methods for working with PortableCompressedTexture2D object instances.
Index ¶
- func IsKeepingAllCompressedBuffers() bool
- func SetKeepAllCompressedBuffers(keep bool)
- type Advanced
- type Any
- type CompressionMode
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsPortableCompressedTexture2D() Instance
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTexture() Texture.Instance
- func (self Instance) AsTexture2D() Texture2D.Instance
- func (self Instance) CreateFromImage(image [1]gdclass.Image, ...)
- func (self Instance) GetCompressionMode() gdclass.PortableCompressedTexture2DCompressionMode
- func (self Instance) GetFormat() gdclass.ImageFormat
- func (self Instance) KeepCompressedBuffer() bool
- func (self Instance) SetKeepCompressedBuffer(value bool)
- func (self Instance) SetSizeOverride(value Vector2.XY)
- func (self Instance) SizeOverride() Vector2.XY
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKeepingAllCompressedBuffers ¶
func IsKeepingAllCompressedBuffers() bool
Return whether the flag is overridden for all textures of this type.
func SetKeepAllCompressedBuffers ¶
func SetKeepAllCompressedBuffers(keep bool)
Overrides the flag globally for all textures of this type. This is used primarily by the editor.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type CompressionMode ¶
type CompressionMode = gdclass.PortableCompressedTexture2DCompressionMode //gd:PortableCompressedTexture2D.CompressionMode
const ( CompressionModeLossless CompressionMode = 0 CompressionModeLossy CompressionMode = 1 CompressionModeBasisUniversal CompressionMode = 2 CompressionModeS3tc CompressionMode = 3 CompressionModeEtc2 CompressionMode = 4 CompressionModeBptc CompressionMode = 5 )
type Instance ¶
type Instance [1]gdclass.PortableCompressedTexture2D
This class allows storing compressed textures as self contained (not imported) resources. For 2D usage (compressed on disk, uncompressed on VRAM), the lossy and lossless modes are recommended. For 3D usage (compressed on VRAM) it depends on the target platform. If you intend to only use desktop, S3TC or BPTC are recommended. For only mobile, ETC2 is recommended. For portable, self contained 3D textures that work on both desktop and mobile, Basis Universal is recommended (although it has a small quality cost and longer compression time as a tradeoff). This resource is intended to be created from code.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsPortableCompressedTexture2D ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTexture2D ¶
func (Instance) CreateFromImage ¶
func (self Instance) CreateFromImage(image [1]gdclass.Image, compression_mode gdclass.PortableCompressedTexture2DCompressionMode)
Initializes the compressed texture from a base image. The compression mode must be provided. [param normal_map] is recommended to ensure optimum quality if this image will be used as a normal map. If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality.
func (Instance) GetCompressionMode ¶
func (self Instance) GetCompressionMode() gdclass.PortableCompressedTexture2DCompressionMode
Return the compression mode used (valid after initialized).
func (Instance) GetFormat ¶
func (self Instance) GetFormat() gdclass.ImageFormat
Return the image format used (valid after initialized).