unreal.PaperSprite

class unreal.PaperSprite(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

Sprite Asset

Stores the data necessary to render a single 2D sprite (from a region of a texture) Can also contain collision shapes for the sprite. see: UPaperSpriteComponent

C++ Source:

  • Plugin: Paper2D

  • Module: Paper2D

  • File: PaperSprite.h

Editor Properties: (see get_editor_property/set_editor_property)

  • additional_source_textures (Array[Texture]): [Read-Write] Additional Source Textures: Additional source textures for other slots

  • alternate_material (MaterialInterface): [Read-Write] Alternate Material: The alternate material to use on a sprite instance if not overridden (this is only used for Diced render geometry, and will be the opaque material in that case, slot 1)

  • atlas_group (PaperSpriteAtlas): [Read-Write] Atlas Group: Spritesheet group that this sprite belongs to

  • body_setup (BodySetup): [Read-Write] Body Setup: Baked physics data.

  • collision_geometry (SpriteGeometryCollection): [Read-Write] Collision Geometry: Custom collision geometry polygons (in texture space)

  • collision_thickness (float): [Read-Write] Collision Thickness: The extrusion thickness of collision geometry when using a 3D collision domain

  • custom_pivot_point (Vector2D): [Read-Write] Custom Pivot Point: Custom pivot point (relative to the sprite rectangle)

  • default_material (MaterialInterface): [Read-Write] Default Material: The material to use on a sprite instance if not overridden (this is the default material when only one is being used, and is the translucent/masked material for Diced render geometry, slot 0)

  • origin_in_source_image_before_trimming (Vector2D): [Read-Write] Origin in Source Image Before Trimming: Origin within SourceImage, prior to atlasing

  • pivot_mode (SpritePivotMode): [Read-Write] Pivot Mode: Pivot mode

  • pixels_per_unreal_unit (float): [Read-Write] Pixels Per Unreal Unit: The scaling factor between pixels and Unreal units (cm) (e.g., 0.64 would make a 64 pixel wide sprite take up 100 cm)

  • render_geometry (SpriteGeometryCollection): [Read-Write] Render Geometry: Custom render geometry polygons (in texture space)

  • rotated_in_source_image (bool): [Read-Write] Rotated in Source Image: This texture is rotated in the atlas

  • snap_pivot_to_pixel_grid (bool): [Read-Write] Snap Pivot to Pixel Grid: Should the pivot be snapped to a pixel boundary?

  • sockets (Array[PaperSpriteSocket]): [Read-Write] Sockets: List of sockets on this sprite

  • source_dimension (Vector2D): [Read-Write] Source Dimension: Dimensions within SourceTexture (in pixels)

  • source_image_dimension_before_trimming (Vector2D): [Read-Write] Source Image Dimension Before Trimming: Dimensions of SourceImage

  • source_texture (Texture2D): [Read-Write] Source Texture: The source texture that the sprite comes from

  • source_texture_dimension (Vector2D): [Read-Write] Source Texture Dimension: Dimension of the texture when this sprite was created Used when the sprite is resized at some point

  • source_uv (Vector2D): [Read-Write] Source UV: Position within SourceTexture (in pixels)

  • sprite_collision_domain (SpriteCollisionMode): [Read-Write] Sprite Collision Domain: Collision domain (no collision, 2D, or 3D)

  • trimmed_in_source_image (bool): [Read-Write] Trimmed in Source Image: This texture is trimmed, consider the values above

property alternate_material: MaterialInterface

[Read-Only] Alternate Material: The alternate material to use on a sprite instance if not overridden (this is only used for Diced render geometry, and will be the opaque material in that case, slot 1)

Type:

(MaterialInterface)

property default_material: MaterialInterface

[Read-Only] Default Material: The material to use on a sprite instance if not overridden (this is the default material when only one is being used, and is the translucent/masked material for Diced render geometry, slot 0)

Type:

(MaterialInterface)