Documentation ¶
Overview ¶
Package ns implements NoxScript 4 used in OpenNox maps.
NS4 is based on NoxScript 3 but provides a more Go-friendly object-oriented API.
These changes include:
- Most functions became methods on the corresponding object types. - Functions have a more generic signature, using interfaces where appropriate. - Similar methods were renamed, e.g. ObjectOn and WaypointOn is now called Enable for both types. - Type safety was improved. Package defines more names types for enums. - All enum constants were moved to their own sub-packages.
Package is compatible with NS3: methods like AsObj convert NS3 objects into NS4 objects.
Index ¶
- Constants
- func AudioEvent(audio audio.Name, p Positioner)
- func AutoSave()
- func BecomeEnemy(obj Obj)
- func BecomePet(obj Obj)
- func Blind()
- func CancelDialog(obj Obj)
- func CastSpell(spell spell.Spell, source, target Positioner)
- func ClearMessages(player Obj)
- func DeathScreen(which int)
- func DestroyEveryChat()
- func Effect(effect effect.Effect, p1, p2 Positioner)
- func EndGame(class player.Class)
- func GetCharacterData(field int) int
- func GetQuestStatus(name string) int
- func GetQuestStatusFloat(name string) float32
- func ImmediateBlind()
- func IsCaller(obj Obj) bool
- func IsCrown(obj Obj) bool
- func IsGameBall(obj Obj) bool
- func IsSummoned(obj Obj) bool
- func IsTalking() bool
- func IsTrading() bool
- func IsTrigger(obj Obj) bool
- func JournalDelete(obj Obj, message StringID)
- func JournalEdit(obj Obj, message StringID, typ EntryType)
- func JournalEntry(obj Obj, message StringID, typ EntryType)
- func MakeEnemy(obj Obj)
- func MakeFriendly(obj Obj)
- func Music(music int, volume int)
- func MusicEvent()
- func MusicPopEvent()
- func MusicPushEvent()
- func NoWallSound(noWallSound bool)
- func Print(message StringID)
- func PrintToAll(message StringID)
- func Random(min int, max int) int
- func RandomFloat(min float32, max float32) float32
- func ResetQuestStatus(name string)
- func SetDialog(obj Obj, typ DialogType, start Func, end Func)
- func SetHalberd(upgrade HalberdLevel)
- func SetQuestStatus(status int, name string)
- func SetQuestStatusFloat(status float32, name string)
- func SetRuntime(r Implementation)
- func SetShopkeeperText(obj Obj, text StringID)
- func StartDialog(obj Obj, other Obj)
- func StartupScreen(which int)
- func StopScript(value any)
- func StoryPic(obj Obj, name string)
- func TellStory(audio audio.Name, story StringID)
- func UnBlind()
- func Unknownb8(id int) bool
- func Unknownb9(id int) bool
- func Unknownc4()
- func Unused1f(id int)
- func Unused20(id int)
- func Unused50()
- func Unused58(arg1 int, arg2 int)
- func Unused59(arg1 int, arg2 int)
- func Unused5a(arg1 int, arg2 int)
- func Unused5b(arg1 int, arg2 int)
- func Unused5c(arg1 int, arg2 int)
- func Unused5d(arg1 int, arg2 int)
- func Unused5e(str string) int
- func Unused74(arg1 int, arg2 int)
- func WideScreen(enable bool)
- type DialogAnswer
- type DialogType
- type Direction
- type EntryType
- type Func
- type Game
- type HalberdLevel
- type Handle
- type Implementation
- type Obj
- type ObjGroup
- type ObjGroupHandle
- type ObjHandle
- type ObjectEvent
- type Pointf
- type Positioner
- type StringID
- type Timer
- type TimerHandle
- type WallGroupHandle
- type WallGroupObj
- type WallHandle
- type WallObj
- type WaypointGroupHandle
- type WaypointGroupObj
- type WaypointHandle
- type WaypointObj
Constants ¶
const ( DialogNormal = DialogType("NORMAL") DialogNext = DialogType("NEXT") DialogYesNo = DialogType("YESNO") DialogYesNoNext = DialogType("YESNONEXT") DialogFalse = DialogType("FALSE") )
const ( AnswerGoodbye = DialogAnswer(0) AnswerYes = DialogAnswer(1) AnswerNo = DialogAnswer(2) )
const ( EventEnemySighted = ObjectEvent(3) EventLookingForEnemy = ObjectEvent(4) EventDeath = ObjectEvent(5) EventChangeFocus = ObjectEvent(6) EventIsHit = ObjectEvent(7) EventRetreat = ObjectEvent(8) EventCollision = ObjectEvent(9) EventEnemyHeard = ObjectEvent(10) EventEndOfWaypoint = ObjectEvent(11) EventLostEnemy = ObjectEvent(13) )
const ( OblivionHalberd = HalberdLevel(0) OblivionHeart = HalberdLevel(1) OblivionWierdling = HalberdLevel(2) OblivionOrb = HalberdLevel(3) )
const ( EntryGreen1 = EntryType(0) // green text, no sound EntryWhite = EntryType(1) // white text EntryRed = EntryType(2) // red text with quest label EntryGreen2 = EntryType(3) // green text EntryGrey = EntryType(4) // grey text with completed label EntryYellow = EntryType(8) // yellow text with hint label )
Variables ¶
This section is empty.
Functions ¶
func AudioEvent ¶
func AudioEvent(audio audio.Name, p Positioner)
AudioEvent play an audio event at a location.
func CastSpell ¶
func CastSpell(spell spell.Spell, source, target Positioner)
CastSpell casts a spell from source to target.
Example: ns.CastSpell(spell.DEATH_RAY, ns.Object("CruelDude"), ns.GetHost()) ns.CastSpell(spell.DEATH_RAY, ns.Ptf(10, 5), ns.Waypoint("Target"))
func ClearMessages ¶
func ClearMessages(player Obj)
ClearMessages clears messages on player's screen.
func Effect ¶
func Effect(effect effect.Effect, p1, p2 Positioner)
Effect triggers an effect from point p1 to p2. Some effects only have one point, in which case p2 is ignored.
func GetCharacterData ¶
GetCharacterData gets information about the loaded character.
func GetQuestStatusFloat ¶
GetQuestStatusFloat gets quest status (float).
func IsSummoned ¶
IsSummoned gets whether object is a summoned creature.
func IsTrading ¶
func IsTrading() bool
IsTrading returns whether the host is currently talking to shopkeeper.
func JournalDelete ¶
JournalDelete deletes entry from player's journal.
If the player object is nil, then it will delete the journal entry for all players.
func JournalEdit ¶
JournalEdit edits entry in player's journal.
If the player object is nil, then it will edit the journal entry for all players.
func JournalEntry ¶
JournalEntry adds entry to player's journal.
If the player object is nil, then it will add the journal entry to all players.
func MusicEvent ¶
func MusicEvent()
func MusicPopEvent ¶
func MusicPopEvent()
func MusicPushEvent ¶
func MusicPushEvent()
func Print ¶
func Print(message StringID)
Print displays a localized string on the screen of Other.
If the string is not in the string database, it will instead print an error message with "MISSING:".
func PrintToAll ¶
func PrintToAll(message StringID)
PrintToAll displays a localized string to everyone.
If the string is not in the string database, it will instead print an error message with "MISSING:".
func RandomFloat ¶
RandomFloat generates random float.
func ResetQuestStatus ¶
func ResetQuestStatus(name string)
ResetQuestStatus deletes a quest status.
The name can be a wildcard with an asterisk or with a map name.
func SetDialog ¶
func SetDialog(obj Obj, typ DialogType, start Func, end Func)
SetDialog sets up a conversation with object.
The type of conversation is one of: DialogNormal, DialogNext, DialogYesNo, DialogYesNoNext. The start and end are script functions that are called at the start and end of the conversation.
If using a DialogYesNo conversation, the end script function should use GetAnswer to retrieve the result.
func SetQuestStatus ¶
SetQuestStatus sets quest status (int).
func SetQuestStatusFloat ¶
SetQuestStatusFloat sets quest status (float).
func SetRuntime ¶
func SetRuntime(r Implementation)
SetRuntime is used by the script host to bind runtime for the script package. Scripts must not call this functions.
func SetShopkeeperText ¶
SetShopkeeperText sets shopkeeper text.
func StartDialog ¶
StartDialog starts a conversation between two objects.
This requires that SetDialog has already been used to set up the conversation on the object.
func TellStory ¶
TellStory causes the telling of a story.
This will cause a story to be told. It relies on Self and Other to be particular values, which limits this to being used in the SetDialog callbacks.
Example:
TellStory(audio.SwordsmanHurt, "Con05:OgreTalk07")
func WideScreen ¶
func WideScreen(enable bool)
WideScreen enables or disables cinematic wide-screen effect.
Types ¶
type DialogAnswer ¶
type DialogAnswer int
type DialogType ¶
type DialogType string
type Game ¶
type Game interface { script.Game // NoxScript returns implementation of NoxScript runtime. NoxScript() Implementation }
Game is an optional interface for script.Game that exposes NoxScript runtime.
type HalberdLevel ¶
type HalberdLevel int
type Handle ¶
type Handle interface { // ScriptID returns internal script ID for the object. ScriptID() int }
type Implementation ¶
type Implementation interface { TimerByHandle(h TimerHandle) Timer NewTimer(dt script.Duration, fnc Func, args ...any) Timer RandomFloat(min float32, max float32) float32 Random(min int, max int) int StopScript(value any) AutoSave() StartupScreen(which int) DeathScreen(which int) ObjectByHandle(h ObjHandle) Obj Object(name string) Obj ObjectGroupByHandle(h ObjGroupHandle) ObjGroup ObjectGroup(name string) ObjGroup CreateObject(typ string, pos Positioner) Obj GetTrigger() Obj GetCaller() Obj GetHost() Obj IsTrigger(obj Obj) bool IsCaller(obj Obj) bool IsGameBall(obj Obj) bool IsCrown(obj Obj) bool IsSummoned(obj Obj) bool MakeFriendly(obj Obj) MakeEnemy(obj Obj) BecomePet(obj Obj) BecomeEnemy(obj Obj) GetCharacterData(field int) int Print(message StringID) PrintToAll(message StringID) ClearMessages(player Obj) UnBlind() Blind() ImmediateBlind() WideScreen(enable bool) IsTalking() bool IsTrading() bool SetHalberd(upgrade HalberdLevel) EndGame(class player.Class) DestroyEveryChat() SetShopkeeperText(obj Obj, text StringID) SetDialog(obj Obj, typ DialogType, start Func, end Func) CancelDialog(obj Obj) StoryPic(obj Obj, name string) TellStory(audio audio.Name, story StringID) StartDialog(obj Obj, other Obj) GetAnswer(obj Obj) DialogAnswer AudioEvent(audio audio.Name, p Positioner) Music(music int, volume int) MusicPushEvent() MusicPopEvent() MusicEvent() Effect(effect effect.Effect, p1, p2 Positioner) CastSpell(spell spell.Spell, source, target Positioner) GetQuestStatus(name string) int GetQuestStatusFloat(name string) float32 SetQuestStatus(status int, name string) SetQuestStatusFloat(status float32, name string) ResetQuestStatus(name string) JournalEntry(obj Obj, message StringID, typ EntryType) JournalEdit(obj Obj, message StringID, typ EntryType) JournalDelete(obj Obj, message StringID) WaypointByHandle(h WaypointHandle) WaypointObj Waypoint(name string) WaypointObj WaypointGroupByHandle(h WaypointGroupHandle) WaypointGroupObj WaypointGroup(name string) WaypointGroupObj NoWallSound(noWallSound bool) WallByHandle(h WallHandle) WallObj Wall(x int, y int) WallObj WallGroupByHandle(h WallGroupHandle) WallGroupObj WallGroup(name string) WallGroupObj Unused1f(id int) Unused20(id int) Unused50() Unused58(arg1 int, arg2 int) Unused59(arg1 int, arg2 int) Unused5a(arg1 int, arg2 int) Unused5b(arg1 int, arg2 int) Unused5c(arg1 int, arg2 int) Unused5d(arg1 int, arg2 int) Unused5e(str string) int Unused74(arg1 int, arg2 int) Unknownb8(id int) bool Unknownb9(id int) bool Unknownc4() }
Implementation of the script runtime.
func Runtime ¶
func Runtime() Implementation
Runtime returns implementation of all the accessible functions as an interface.
type Obj ¶
type Obj interface { ObjHandle // Pos returns current position of the object. Pos() Pointf // SetPos instantly moves object to a given position. SetPos(p Pointf) // Z returns current Z offset for the object. Z() float32 // SetZ sets Z offset for the object. SetZ(z float32) // IsEnabled checks if object is currently enabled. IsEnabled() bool // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool // IsLocked checks if object is currently locked. IsLocked() bool // Lock or unlock the object. Lock(lock bool) // Class returns object class. Class() object.Class // HasClass checks whether object has a class. // It uses string values instead of enum as Class does. HasClass(class class.Class) bool // HasSubclass tests whether an item has a specific subclass. // The subclass overlaps, so you should probably test for the class first (via HasClass). HasSubclass(subclass subclass.SubClass) bool // HasEnchant gets whether object has an enchant. HasEnchant(enchant enchant.Enchant) bool // Direction gets object direction. // // See LookWithAngle. Direction() Direction // CurrentHealth gets object's health. CurrentHealth() int // MaxHealth gets object's maximum health. MaxHealth() int // RestoreHealth restores object's health. RestoreHealth(amount int) // GetGold gets amount of gold for player object. GetGold() int // ChangeGold changes amount of gold for player object. ChangeGold(delta int) // GiveXp grants experience to a player. GiveXp(xp float32) // GetScore gets player's score. GetScore() int // ChangeScore changes player's score. ChangeScore(score int) // HasOwner checks whether target is owned by object. HasOwner(owner Obj) bool // HasOwnerIn checks whether target is owned by any object in the group. HasOwnerIn(owners ObjGroup) bool // SetOwner makes an object the owner of the target. This will make the target // friendly to the owner, and it will accredit the target's kills to the owner. // // Passing nil will clear the owner. // // For example, in a multiplayer map, you might have a switch that activates a // hazard. You can use this so that if the hazard kills anyone, the player who // activated the hazard gets the credit. SetOwner(owner Obj) // SetOwners is the same as SetOwner but with an object group as the owner. SetOwners(owners ObjGroup) // Freeze or unfreeze an object in place. Freeze(freeze bool) // Pause an object temporarily. Pause(dt script.Duration) // Move an object to a waypoint. The object must be movable or attached to a "Mover". // // If the waypoint is linked, the object will continue to move once it reaches the first waypoint. Move(wp WaypointObj) // WalkTo causes an object to walk to a location. WalkTo(p Pointf) // LookAtDirection causes object to look in a direction. LookAtDirection(dir Direction) // LookWithAngle sets an object's direction. The direction is an angle represented as an integer between 0 and 255. // Due east is 0, and the angle increases as the object turns clock-wise. LookWithAngle(angle int) // LookAtObject sets direction of object so it is looking at another object. LookAtObject(target Positioner) // CanSee first checks if the location of the objects are within 512 of each other coordinate-wise. It not, it returns false. // // It then checks whether the first object can see the second object. CanSee(obj Obj) bool // ApplyForce applies a force vector to an object. ApplyForce(force Pointf) // PushTo calculate a unit vector from the object's location to the specified // location, and multiply it by the specified magnitude. This vector will be // applied as a force via ApplyForce. PushTo(pos Positioner, force float32) // Damage the target with a given source object, amount, and damage type. Damage(source Obj, amount int, typ damage.Type) // Delete an object. Delete() // DeleteAfter delete object after a delay. DeleteAfter(dt script.Duration) // Idle causes creature to idle. Idle() // Wander causes an object to wander. Wander() // Hunt causes creature to hunt. Hunt() // Return cause object to move to its starting location. Return() // Follow causes a creature to follow target, and it won't attack anything unless disrupted or instructed to. Follow(target Positioner) // Guard causes a creature to move to a location, guard a nearby location, // and attack any enemies that move within range of the guarded location. Guard(p1, p2 Pointf, distance float32) // Attack a target. Attack(target Positioner) // IsAttackedBy gets whether object is being attacked by another object. IsAttackedBy(by Obj) bool // HitMelee causes object to melee attacks a location. HitMelee(p Pointf) // HitRanged causes object to ranged attacks a location. HitRanged(p Pointf) // Flee causes creature to run away from target. Flee(target Positioner, dt script.Duration) // HasItem gets whether the item is in the object's inventory. HasItem(item Obj) bool // GetLastItem returns the object of the last item in the object's inventory. If the inventory is empty, it returns nil. // // This is used with GetPreviousItem to iterate through an object's inventory. // // Example: // // for it := obj.GetLastItem(); it != nil; it = it.GetPreviousItem() { // // ... // } GetLastItem() Obj // GetPreviousItem returns the object of the previous item in the inventory from the given object. // If the specified object is not in an inventory, or there are no more items in the inventory, it returns nil. // // This is used with GetLastItem to iterate through an object's inventory. GetPreviousItem() Obj // GetHolder returns the object that contains the item in its inventory. GetHolder() Obj // Pickup cause object to pickup an item. Pickup(item Obj) bool // Drop cause object to drop an item. Drop(item Obj) bool // ZombieStayDown sets zombie to stay down. ZombieStayDown() // RaiseZombie raises a zombie. Also clears stay down state. RaiseZombie() // Chat displays a localized string in a speech bubble. // // If the string is not in the string database, it will instead print an error message with "MISSING:". Chat(message StringID) // ChatTimer displays a localized string in a speech bubble for a given duration (in seconds or frames). // // If the string is not in the string database, it will instead print an error message with "MISSING:". ChatTimer(message StringID, dt script.Duration) // DestroyChat destroys object's speech bubble. DestroyChat() // CreateMover creates a Mover for an object. CreateMover(wp WaypointObj, speed float32) Obj // GetElevatorStatus gets elevator status. GetElevatorStatus() int // AggressionLevel sets a creature's aggression level. The most commonly used value is 0.83. AggressionLevel(level float32) // SetRoamFlag sets roaming flags for object. Default is 0x80. SetRoamFlag(flags int) // RetreatLevel causes the creature to retreat if its health falls below the specified percentage (0.0 - 1.0). RetreatLevel(percent float32) // ResumeLevel causes the creature to stop retreating if its health is above the specified percentage (0.0 - 1.0). ResumeLevel(percent float32) // AwardSpell awards spell level to object. // // This will raise the spell level of the object. // If the object can not cast this spell then it will have no effect. AwardSpell(spell spell.Spell) bool // Enchant grants object an enchantment of a specified duration. Enchant(enchant enchant.Enchant, dt script.Duration) // EnchantOff removes enchant from an object. EnchantOff(enchant enchant.Enchant) // TrapSpells sets spells on a bomber. TrapSpells(spell1 spell.Spell, spell2 spell.Spell, spell3 spell.Spell) // OnEvent sets a function script to call for an event. OnEvent(event ObjectEvent, fnc Func) }
func CreateObject ¶
func CreateObject(typ string, pos Positioner) Obj
CreateObject creates an object given a type and a starting location.
Example: spider := CreateObject("SmallAlbinoSpider", Waypoint("SpiderHole"))
func GetCaller ¶
func GetCaller() Obj
GetCaller returns object that was the target of an event, if valid.
func GetTrigger ¶
func GetTrigger() Obj
GetTrigger returns object which triggered an event, if valid.
type ObjGroup ¶
type ObjGroup interface { ObjGroupHandle // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool // HasOwner checks whether any object in target group is owned by object. HasOwner(owner Obj) bool // HasOwnerIn checks whether any object in target is owned by any object in the group. HasOwnerIn(owners ObjGroup) bool // SetOwner sets the owner for each object in a group. See Obj.SetOwner for details. SetOwner(owner Obj) // SetOwners is the same as SetOwner but with an object group as the owner. SetOwners(owners ObjGroup) // Pause objects of a group temporarily. Pause(dt script.Duration) // Move moves the objects in a group to a waypoint. The objects must be movable or attached to a "Mover". // // If the waypoint is linked, the objects will continue to move once they reach the first waypoint. Move(wp WaypointObj) // WalkTo causes objects in a group to walk to a location. WalkTo(p Pointf) // LookAtDirection causes objects in a group to look in a direction. LookAtDirection(dir Direction) // Damage damages the target objects with a given source object, amount, and damage type. Damage(source Obj, amount int, typ damage.Type) // Delete deletes objects in a group. Delete() // Idle causes creatures in a group to idle. Idle() // Wander cause objects in a group to wander. Wander() // Hunt causes creatures in a group to hunt. Hunt() // Follow causes the creatures to follow target, and they won't attack anything unless disrupted or instructed to. Follow(target Positioner) // Guard is the same as CreatureGuard but applies to creatures in a group. Guard(p1, p2 Pointf, distance float32) // Flee causes creatures to run away from target. Flee(target Positioner, dt script.Duration) // HitMelee causes objects in a group to melee attacks a location. HitMelee(p Pointf) // HitRanged causes objects in a group to ranged attacks a location. HitRanged(p Pointf) // Attack causes objects in a group to attack a target. Attack(target Positioner) // ZombieStayDown sets group of zombies to stay down. ZombieStayDown() // RaiseZombie raises a zombie group. Also clears stay down state. RaiseZombie() // CreateMover creates a Mover for every object in a group. CreateMover(wp WaypointObj, speed float32) // AggressionLevel sets a group of creature's aggression level. The most commonly used value is 0.83. AggressionLevel(level float32) // SetRoamFlag sets roaming flags for objects in a group. Default is 0x80. SetRoamFlag(flags int) // RetreatLevel causes the creatures to retreat if its health falls below the specified percentage (0.0 - 1.0). RetreatLevel(percent float32) // ResumeLevel causes the creatures to stop retreating if its health is above the specified percentage (0.0 - 1.0). ResumeLevel(percent float32) // AwardSpell awards spell level to objects in a group. // // This will raise the spell level of the objects in the group. // If an object can not cast this spell then it will have no effect on that object. AwardSpell(spell spell.Spell) // Enchant grants objects in a group an enchantment of a specified duration. Enchant(enchant enchant.Enchant, dt script.Duration) // EachObject calls fnc for all objects in the group. // If fnc returns false, the iteration stops. // If recursive is true, iteration will include items from nested groups. EachObject(recursive bool, fnc func(obj Obj) bool) }
func AsObjGroup ¶
func AsObjGroup(h ObjGroupHandle) ObjGroup
AsObjGroup looks up a ObjGroup for a given handle.
func ObjectGroup ¶
ObjectGroup looks up object group by name.
type ObjGroupHandle ¶
type ObjectEvent ¶
type ObjectEvent int
type Positioner ¶
type Positioner interface { // Pos returns current position of the object. Pos() Pointf }
Positioner is an interface for objects that have position on the map.
type StringID ¶
type StringID = string
StringID is an ID of a localized string in the string database.
type Timer ¶
type Timer interface { TimerHandle // Cancel a timer. Returns true if successful. Cancel() bool }
type TimerHandle ¶
type WallGroupHandle ¶
type WallGroupObj ¶
type WallGroupObj interface { WallGroupHandle // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool // Destroy breaks walls in a group. Destroy() // EachWall calls fnc for all walls in the group. // If fnc returns false, the iteration stops. // If recursive is true, iteration will include items from nested groups. EachWall(recursive bool, fnc func(obj WallObj) bool) }
WallGroupObj is a group of walls.
func AsWallGroup ¶
func AsWallGroup(h WallGroupHandle) WallGroupObj
AsWallGroup looks up a WallGroupObj for a given handle.
type WallHandle ¶
type WallObj ¶
type WallObj interface { WallHandle // IsEnabled checks if object is currently enabled. IsEnabled() bool // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool // Destroy breaks a wall. Destroy() }
WallObj is a pointer to a wall.
type WaypointGroupHandle ¶
type WaypointGroupObj ¶
type WaypointGroupObj interface { WaypointGroupHandle // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool // EachWaypoint calls fnc for all waypoints in the group. // If fnc returns false, the iteration stops. // If recursive is true, iteration will include items from nested groups. EachWaypoint(recursive bool, fnc func(obj WaypointObj) bool) }
func AsWaypointGroup ¶
func AsWaypointGroup(h WaypointGroupHandle) WaypointGroupObj
AsWaypointGroup looks up a WaypointGroupObj for a given handle.
func WaypointGroup ¶
func WaypointGroup(name string) WaypointGroupObj
WaypointGroup looks up waypoint group by name.
type WaypointHandle ¶
type WaypointObj ¶
type WaypointObj interface { WaypointHandle // Pos returns current position of the object. Pos() Pointf // SetPos instantly moves object to a given position. SetPos(p Pointf) // IsEnabled checks if object is currently enabled. IsEnabled() bool // Enable or disable the object. Enable(enable bool) // Toggle the object's enabled state. // It returns the new state after toggling the object. Toggle() bool }
func AsWaypoint ¶
func AsWaypoint(h WaypointHandle) WaypointObj
AsWaypoint looks up a WaypointObj for a given handle.