PortableCompressedTexture2D

package
v0.0.0-...-a7442fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package PortableCompressedTexture2D provides methods for working with PortableCompressedTexture2D object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsPortableCompressedTexture2D() Instance
}

type CompressionMode

type CompressionMode int //gd:PortableCompressedTexture2D.CompressionMode
const (
	CompressionModeLossless       CompressionMode = 0
	CompressionModeLossy          CompressionMode = 1
	CompressionModeBasisUniversal CompressionMode = 2
	CompressionModeS3tc           CompressionMode = 3
	CompressionModeEtc2           CompressionMode = 4
	CompressionModeBptc           CompressionMode = 5
)

type Expanded

func (Expanded) CreateFromImage

func (self Expanded) CreateFromImage(image Image.Instance, compression_mode CompressionMode, normal_map bool, lossy_quality Float.X)

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.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsPortableCompressedTexture2D

func (self *Extension[T]) AsPortableCompressedTexture2D() Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsTexture

func (self *Extension[T]) AsTexture() Texture.Instance

func (*Extension[T]) AsTexture2D

func (self *Extension[T]) AsTexture2D() Texture2D.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

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 New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsPortableCompressedTexture2D

func (self Instance) AsPortableCompressedTexture2D() Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTexture

func (self Instance) AsTexture() Texture.Instance

func (Instance) AsTexture2D

func (self Instance) AsTexture2D() Texture2D.Instance

func (Instance) CreateFromImage

func (self Instance) CreateFromImage(image Image.Instance, compression_mode CompressionMode)

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() CompressionMode

Return the compression mode used (valid after initialized).

func (Instance) GetFormat

func (self Instance) GetFormat() Image.Format

Return the image format used (valid after initialized).

func (Instance) ID

func (self Instance) ID() ID

func (Instance) KeepCompressedBuffer

func (self Instance) KeepCompressedBuffer() bool

func (Instance) SetKeepCompressedBuffer

func (self Instance) SetKeepCompressedBuffer(value bool)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetSizeOverride

func (self Instance) SetSizeOverride(value Vector2.XY)

func (Instance) SizeOverride

func (self Instance) SizeOverride() Vector2.XY

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL