Graphic

A Resource corresponding to a .png or .jpeg file.

The contents of this file may be a single image, or a collection of smaller images (often arranged in a grid pattern). Collections of smaller images are called an Atlases. However, there is no Atlas class. Instead, the Graphic's children will consist of Poses, where the pose defines the rectangular region within the Graphic.

Constructors

Link copied to clipboard
constructor(parent: ParentResource, name: String, filename: String)

Properties

Link copied to clipboard
Link copied to clipboard
open override val children: MutableObservableMap<String, Resource>
Link copied to clipboard
open override val filename: String
Link copied to clipboard
val height: Int
Link copied to clipboard
open override val image: Image
Link copied to clipboard
override var name: String
Link copied to clipboard
override var parent: ParentResource
Link copied to clipboard
open override var pin: Vector2
Link copied to clipboard
Link copied to clipboard
open override val resourceType: ResourceType
Link copied to clipboard
var texture: Texture
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
open override fun add(child: Resource)
Link copied to clipboard
open override fun appearance(): Appearance

Pose and Graphic return themselves. NinePatch returns a NinePatchAppearance.

Link copied to clipboard
open override fun appearanceForActor(actor: Actor): Appearance

Creates an Appearance with the same tint. Also, if the new appearances is StretchableAppearance then it will have the same bounds as the previous appearance.

Link copied to clipboard
open fun applyToActor(actor: Actor)

Set the actor's appearance.

Link copied to clipboard
open override fun dangerousRename(newName: String)
Link copied to clipboard
open fun find(path: String): Resource?
Link copied to clipboard
Link copied to clipboard
open override fun findChild(name: String): Resource?
Link copied to clipboard
open fun findUnresolved(path: String): Resource?
Link copied to clipboard
override fun game(): Game
Link copied to clipboard
override fun path(): String
Link copied to clipboard

Similar to path, but it also includes a trailing path. This is useful when building descendant paths as there is no special case needed for the root Game.

Link copied to clipboard
open override fun remove(child: Resource)
Link copied to clipboard
open override fun rename(child: Resource, newName: String)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun walkTree(onVisit: (Resource) -> Unit)