O1Library Docs
Fall 2023
Docs API

# HasAnchor

o1.world.objects.HasAnchor
trait HasAnchor extends HasSize

A supertype for objects that have an anchoring point.

## Attributes

Graph
Supertypes
  trait HasSize
  class Object
  trait Matchable
  class Any
Known subtypes
  trait HasEdges
  trait HasContainer
  trait ContainedObject
  trait MovingObjectInContainer

## Members list

### Value members

#### Abstract methods

def anchor: Anchor

the object’s anchoring point

the object’s anchoring point

## Attributes

#### Concrete methods

def internalAnchorPos: Pos

Returns the Pos of the anchoring point within this object, expressed as coordinates relative to the object’s top left-hand corner.

Returns the Pos of the anchoring point within this object, expressed as coordinates relative to the object’s top left-hand corner.

## Attributes

def internalAnchorX: Double

Returns the x coordinate of the anchoring point within this object, relative to the object’s left edge.

Returns the x coordinate of the anchoring point within this object, relative to the object’s left edge.

## Attributes

def internalAnchorY: Double

Returns the y coordinate of the anchoring point within this object, relative to the object’s top edge.

Returns the y coordinate of the anchoring point within this object, relative to the object’s top edge.

## Attributes

#### Inherited methods

def centerFromTopLeft: Pos

the location of this object’s center: the average point between its edges, expressed in coordinates relative to the object’s top left-hand corner

the location of this object’s center: the average point between its edges, expressed in coordinates relative to the object’s top left-hand corner

## Attributes

Inherited from:
  HasSize

def height: Double

this object’s height: the distance from its top edge to its bottom edge

this object’s height: the distance from its top edge to its bottom edge

## Attributes

Inherited from:
  HasSize

def width: Double

this object’s width: the distance from its left edge to its right edge

this object’s width: the distance from its left edge to its right edge

## Attributes

Inherited from:
  HasSize