Skip to content
reduz edited this page Oct 15, 2014 · 10 revisions

Texture

####Inherits: Resource ####Category: Core

Brief Description

Texture for 2D and 3D.

Member Functions

Numeric Constants

  • FLAG_MIPMAPS = 1 - Generate mipmaps.
  • FLAG_REPEAT = 2 - Repeat (instead of clamp to edge).
  • FLAG_FILTER = 4 - Turn on magnifying filter.
  • FLAG_VIDEO_SURFACE = 4096 - Texture is a video surface
  • FLAGS_DEFAULT = 7 - Default flags
  • FLAG_ANISOTROPIC_FILTER = 8
  • FLAG_CONVERT_TO_LINEAR = 16

Description

A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D Sprite or GUI Controls.

Member Function Description

  • int get_width ( ) const

Return the texture width.

  • int get_height ( ) const

Return the texture height.

Return the texture size.

  • RID get_rid ( ) const

Return the texture RID as used in the VisualServer.

  • void set_flags ( int flags )

Change the texture flags.

  • int get_flags ( ) const

Return the current texture flags.

  • void draw ( RID canvas_item, Vector2 pos, Color modulate=Color(1,1,1,1) ) const

Draw the texture into a a VisualServer canvas item.

Clone this wiki locally