ImageTexture

Inherits: Texture < Resource < Reference < Object

类别: 核心

简要说明

A Texture 基于 Image .

方法

无效

create ( int width, int height, Format format, int flags=7 )

无效

create_from_image ( Image image, int flags=7 )

Format

get_format ( ) const

Error

load ( String path )

无效

set_data ( Image image )

无效

set_size_override ( Vector2 size )

枚举

枚举 保管部

  • STORAGE_RAW = 0 --- Image 数据是未经修改的原始数据。

  • STORAGE_COMPRESS_LOSSY = 1 --- Image 数据是用有损算法压缩的。您可以使用设置存储质量 lossy_quality .

  • STORAGE_COMPRESS_LOSSLESS = 2 --- Image 数据是用无损算法压缩的。

描述

A Texture 基于 Image . 可以从 Image 具有 create_from_image .

属性描述

违约

0.7

设定器

设置损耗存储质量(值)

吸气剂

获取有损存储质量

存储质量 STORAGE_COMPRESS_LOSSY .

违约

0

设定器

设置存储(值)

吸气剂

获取存储空间()

存储类型(原始、有损或压缩)。

方法说明

创建新的 ImageTexture 具有 widthheight .

format 是来自的值 Formatflags 是不是 Flags .

  • void create_from_image ( Image image, int flags=7 )

创建新的 ImageTexture 从一个 Image 具有 flagsFlags . 根据 Format .

返回的格式 ImageTexture ,其中一个 Format .

加载 ImageTexture 从文件路径。

  • void set_data ( Image image )

设置 Image 其中 ImageTexture .

  • void set_size_override ( Vector2 size )

调整 ImageTexture 到指定的尺寸。