Documentation ¶
Index ¶
- func QuarkToString(id QuarkID) string
- type CQuark
- type Point2I
- func (p *Point2I) Add(x, y int)
- func (p *Point2I) AddPoint(point Point2I)
- func (p *Point2I) ClampToRegion(region Region) (clamped bool)
- func (p Point2I) Clone() (clone Point2I)
- func (p Point2I) Equals(x, y int) bool
- func (p Point2I) EqualsTo(o Point2I) bool
- func (p Point2I) NewClone() (clone *Point2I)
- func (p Point2I) Position() (x, y int)
- func (p *Point2I) Set(x, y int)
- func (p *Point2I) SetPoint(point Point2I)
- func (p Point2I) String() string
- func (p *Point2I) Sub(x, y int)
- func (p *Point2I) SubPoint(point Point2I)
- type QuarkID
- type Range
- type Rectangle
- func (r *Rectangle) Add(w, h int)
- func (r *Rectangle) AddRectangle(size Rectangle)
- func (r *Rectangle) Clamp(minWidth, minHeight, maxWidth, maxHeight int)
- func (r *Rectangle) ClampToRegion(region Region) (clamped bool)
- func (r Rectangle) Clone() (clone Rectangle)
- func (r Rectangle) Equals(w, h int) bool
- func (r Rectangle) EqualsTo(o Rectangle) bool
- func (r *Rectangle) Floor(minWidth, minHeight int)
- func (r Rectangle) NewClone() (clone *Rectangle)
- func (r *Rectangle) Set(w, h int)
- func (r *Rectangle) SetRectangle(size Rectangle)
- func (r Rectangle) String() string
- func (r *Rectangle) Sub(w, h int)
- func (r *Rectangle) SubRectangle(size Rectangle)
- func (r Rectangle) Volume() int
- type Region
- func (r *Region) ClampToRegion(region Region) (clamped bool)
- func (r Region) Clone() (clone Region)
- func (r Region) FarPoint() Point2I
- func (r Region) HasPoint(pos Point2I) bool
- func (r Region) NewClone() (clone *Region)
- func (r Region) Origin() Point2I
- func (r *Region) Set(x, y, w, h int)
- func (r *Region) SetRegion(region Region)
- func (r Region) Size() Rectangle
- func (r Region) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuarkToString ¶
Gets the string associated with the given GQuark.
Parameters:
quark a GQuark.
Returns:
the string associated with the GQuark
Types ¶
type CQuark ¶
type CQuark struct {
// contains filtered or unexported fields
}
Quarks are associations between strings and integer identifiers. Given either the string or the QuarkID identifier it is possible to retrieve the other.
Quarks are used for both datasets and keyed data lists.
To create a new quark from a string, use QuarkFromString().
To find the string corresponding to a given QuarkID, use QuarkID.ToString().
To find the QuarkID corresponding to a given string, use QuarkID.TryString().
type Point2I ¶
type Point2I struct {
X, Y int
}
Point2I is a 2-aspect vector represented by x and y coordinates.
func MakePoint2I ¶
Construct a new Point2I structure (non-pointer)
func NewPoint2I ¶
Construct a new instance of a Point2I structure
func ParsePoint2I ¶
Parse a Point2I structure from a string representation. There are two valid formats supported by this parser function:
formal "{x:0,y:0}" plain "0 0"
func (*Point2I) ClampToRegion ¶
restrict this Point2I instance to be within the boundaries defined by the given region
func (Point2I) Equals ¶
returns true if both the given x and y coordinates and this Point2I are equivalent, returns false otherwise
func (Point2I) EqualsTo ¶
returns true if both the given Point2I and this Point2I are equivalent and false otherwise
func (Point2I) String ¶
returns a formal string representation of the Point2I structure, ie: "{x:0,y:0}"
type QuarkID ¶
type QuarkID uint64
A QuarkID is a non-zero integer which uniquely identifies a particular string. A QuarkID value of zero is associated to nil.
func QuarkFromString ¶
Gets the QuarkID identifying the given string. If the string does not currently have an associated QuarkID, a new QuarkID is created, using a copy of the string.
This function must not be used before library constructors have finished running.
Parameters string a string.
Returns
the QuarkID identifying the string, or 0 if string is nil
func QuarkTryString ¶
Gets the GQuark associated with the given string, or 0 if string is nil or it has no associated QuarkID.
If you want the GQuark to be created if it doesn't already exist, use QuarkFromString().
This function must not be used before library constructors have finished running.
Parameters
string a string.
Returns
the GQuark associated with the string, or 0 if string is nil or there is no GQuark associated with it
type Rectangle ¶
type Rectangle struct {
W, H int
}
Rectangle is a 2-aspect vector represented by width and height values
func MakeRectangle ¶
Construct a new Point2I structure (non-pointer)
func NewRectangle ¶
Construct a new instance of a Point2I structure
func ParseRectangle ¶
Parse a Point2I structure from a string representation. There are two valid formats supported by this parser function:
formal "{w:0,h:0}" plain "0 0"
func (*Rectangle) AddRectangle ¶
add the given Point2I to this Point2I
func (*Rectangle) Clamp ¶
constrain the width and height values to be within the given ranges of min and max values
func (*Rectangle) ClampToRegion ¶
func (Rectangle) Equals ¶
returns true if both the given x and y coordinates and this Point2I are equivalent, returns false otherwise
func (Rectangle) EqualsTo ¶
returns true if both the given Point2I and this Point2I are equivalent and false otherwise
func (*Rectangle) Floor ¶
constrain the width and height values to be at least the given values or greater
func (*Rectangle) SetRectangle ¶
set this Point2I instance to be equivalent to the given Point2I
func (Rectangle) String ¶
returns a formal string representation of the Point2I structure, ie: "{w:0,h:0}"
func (*Rectangle) SubRectangle ¶
subtract the given Point2I's values from this Point2I instance