Structs:TexMan

From ZDoom Wiki
(Redirected from TexMan)
Jump to navigation Jump to search
Note: This feature is for ZScript only.


The TexMan struct contains methods with which to use GZDooms' texture manager, along with enums containing all the flags those methods use. Contrary to what the name might suggest, TexMan works with ANY type of graphic GZDoom uses, not just map textures and flats. This also includes ZDooms' Startup lumps.

Methods

Static

  • TextureID CheckForTexture(String name, int usetype = Type_Any, int flags = TryAny)
    Checks for a graphic with the matching name, and if it finds one, returns its' TextureID.
    • name: The name of the graphic to look for.
    • usetype: The namespace to search for the graphic in. See also: Namespaces
    • Type_Any: Search for a graphic with the specified name in every namespace, this is the default.
    • Type_Wall: Search for wall textures.
    • Type_Flat: Search for sector flat textures.
    • Type_Sprite: Search for sprite graphics.
    • Type_WallPatch: Search for patch graphics that are used to composite new textures with TEXTURES.
    • Type_Build: Search for image types contained within Build engine .art files. See Build tiles for more information. Doesn't actually do anything.
    • Type_SkinSprite: Search for player skin sprites. (Verification needed)
    • Type_Decal: Search for decal graphics defined in DECALDEF.
    • Type_MiscPatch: Search for miscellaneous graphics, e.g menu and automap graphics.
    • Type_FontChar: Search for font character graphics.
    • Type_Override: (Need more info)
    • Type_Autopage: Search for automap backgrounds. (Verification needed)
    • Type_SkinGraphic: (Need more info)
    • Type_Null: Search for null (Non existent) graphics. (Verification needed)
    • Type_FirstDefined: Search for textures that are the first ones defined in the TEXTUREx files, such as DoomWikiLogoIcon.pngAASTINKY.
    • flags: The flags to use for the search.
    • TryAny: Return the first texture that was found with the specified name (Verification needed), this is the default.
    • Overridable: Return whatever graphic the original one was overridden by, instead of only returning the original. (Verification needed)
    • ReturnFirst: Allow the graphic to be returned if it's a Type_FirstDefined type graphic.
    • AllowSkins: Allow the found graphic to be returned if it's a Type_SkinGraphic type graphic.
    • ShortNameOnly: Only look for textures with short names, and ignore textures with full names. (Textures whose name is actually their full file path, instead of an 8 character or less name.)
    • DontCreate: Used by the search for full name textures, if on, then texture manager will not create a long named texture if it can't find one yet. (Verification needed)
    • Localize: Does nothing.
    • ForceLookup: Force the lookup of a long name texture even if it's in the archives' root directory. (Verification needed)
    • NoAlias: Does nothing.
  • String GetName(TextureID tex)
    Does the inverse of CheckForTexture, and returns the string name of a graphic based on its' TextureID.
  • int, int GetSize(TextureID tex)
    Gets the size of the specified graphic in pixels. This method returns two values, the first one is the width of the graphic, and the second one is its' height.
  • Vector2 GetScaledSize(TextureID tex)
    (Need more info)
  • Vector2 GetScaledOffset(TextureID tex)
    (Need more info)
  • int CheckRealHeight(TextureID tex)
    Gets the real height of the graphic (Plus one), by ignoring rows of full empty pixels starting from the bottom of the image until it reaches a row with at least one non-empty pixel.
    • tex: The TextureID to find the true height of.
  • bool OkForLocalization(TextureID patch, String textSubstitute)
    Checks if there is a text substitute of the specified graphic for localization. (Verification needed)
    • patch: The patch graphic to check.
    • textSubstitute: The texture to substitute the graphic with, preferably, this should be a a string from the LANGUAGE file.
  • bool UseGamePalette(TextureID tex)
    Returns true if the graphic uses the games' palette instead of its' own palette. For example, PNG graphics either use no palette (True color), or use their own built-in palette (8-bit color).
  • Canvas GetCanvas(String texture)
    Returns the canvas object used to draw on a canvas texture. This only works with canvas textures created through ANIMDEFS with the CANVASTEXTURE keyword.
  • void SetCameraToTexture(Actor viewpoint, String texture, double fov)
    Changes a camera textures' viewport to that of the specified actor. This only works with textures created through ANIMDEFS with the CAMERATEXTURE keyword.
    • viewpoint: A pointer to the actor to use as the viewpoint of the camera.
    • texture: The name of the cameratexture whose view should be changed.
    • fov: The FOV to use for the actors' camera. To get the camera FOV of the actor itself, use the actors' CameraFOV property. Or if the actor is a player pawn, you can also use the players' FOV by plugging in the FOV or DesiredFOV variables from their PlayerInfo struct. Instead of using the player pawns' CameraFOV property.
  • void SetCameraTextureAspectRatio(String texture, double aspectScale, bool useTextureRatio = true)
    Changes a camera textures' aspect ratio.
    • texture: The name of the camera texture whose aspect ratio should be changed.
    • aspectScale: How much the textures' aspect ratio should be changed. Positive values squish the texture horizontally, negative ones widen it vertically. (Verification needed)
    • useTextureRatio: If false, the textures' aspect ratio can be scaled independently of its' original ratio. If true, aspectScale is simply a multiplier to the existing aspect ratios' size. Default is true.
  • void ReplaceTextures(String from, String to, int flags) (deprecated)
    Deprecated, use the ReplaceTextures method found in the LevelLocals struct instead.

See also