2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								<?xml version="1.0" encoding="UTF-8" ?>  
						 
					
						
							
								
									
										
										
										
											2019-04-01 12:33:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								<class  name= "Texture"  inherits= "Resource"  category= "Core"  version= "3.2" >  
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									<brief_description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Texture for 2D and 3D.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</brief_description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<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 [Control].
							 
						 
					
						
							
								
									
										
										
										
											2018-07-09 16:31:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Textures are often created by loading them from a file. See [method @GDScript.load].
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<tutorials > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</tutorials> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									<methods > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "draw"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "void" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "0"  name= "canvas_item"  type= "RID" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-10 15:37:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											<argument  index= "1"  name= "position"  type= "Vector2" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "2"  name= "modulate"  type= "Color"  default= "Color( 1, 1, 1, 1 )" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "3"  name= "transpose"  type= "bool"  default= "false" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "4"  name= "normal_map"  type= "Texture"  default= "null" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "draw_rect"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "void" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "0"  name= "canvas_item"  type= "RID" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "1"  name= "rect"  type= "Rect2" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "2"  name= "tile"  type= "bool" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "3"  name= "modulate"  type= "Color"  default= "Color( 1, 1, 1, 1 )" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "4"  name= "transpose"  type= "bool"  default= "false" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "5"  name= "normal_map"  type= "Texture"  default= "null" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "draw_rect_region"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "void" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "0"  name= "canvas_item"  type= "RID" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "1"  name= "rect"  type= "Rect2" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "2"  name= "src_rect"  type= "Rect2" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "3"  name= "modulate"  type= "Color"  default= "Color( 1, 1, 1, 1 )" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "4"  name= "transpose"  type= "bool"  default= "false" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "5"  name= "normal_map"  type= "Texture"  default= "null" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<argument  index= "6"  name= "clip_uv"  type= "bool"  default= "true" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</argument> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "get_data"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "Image" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "get_height"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "int" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-23 19:15:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns the texture height.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "get_size"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "Vector2" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-23 19:15:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns the texture size.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "get_width"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "int" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-23 19:15:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Returns the texture width.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<method  name= "has_alpha"  qualifiers= "const" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<return  type= "bool" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</return> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											<description > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											</description> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</method> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</methods> 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-12 00:38:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									<members > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										<member  name= "flags"  type= "int"  setter= "set_flags"  getter= "get_flags" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											The texture's flags.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</member> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									</members> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									<constants > 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-12 00:38:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAGS_DEFAULT"  value= "7"  enum= "Flags" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Default flags. Generate mipmaps, repeat, and filter are enabled.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_MIPMAPS"  value= "1"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-26 16:37:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Generate mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_REPEAT"  value= "2"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-26 16:37:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Repeats texture (instead of clamp to edge).
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_FILTER"  value= "4"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-26 16:37:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Magnifying filter, to enable smooth zooming in of the texture.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_ANISOTROPIC_FILTER"  value= "8"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-26 16:37:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											More effective on planes often shown going to the horrizon as those textures (Walls or Ground for example) get squashed in the viewport to different aspect ratios and regular mipmaps keep the aspect ratio so they don't optimize storage that well in those cases.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_CONVERT_TO_LINEAR"  value= "16"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-12-10 00:43:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Converts texture to SRGB color space.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-24 23:16:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_MIRRORED_REPEAT"  value= "32"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-26 16:37:37 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Repeats texture with alternate sections mirrored.
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-21 00:35:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										<constant  name= "FLAG_VIDEO_SURFACE"  value= "2048"  enum= "Flags" > 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-22 12:56:11 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Texture is a video surface.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										</constant> 
							 
						 
					
						
							
								
									
										
										
										
											2017-09-12 17:42:36 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									</constants> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</class>