s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
voting
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
Voting is open. Play the entries and pick the winner.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Classes
Handle
chevron_left
Classes
class
Handle
Constructors
functions
Handle
Properties
data_object
Anchor
data_object
Canvas
data_object
DragAxis
data_object
DragEnabled
data_object
DragOrigin
data_object
IsDragging
data_object
LockAxisWithShift
data_object
MovementAxis
data_object
MovementBounds
data_object
Position
data_object
Positioned
data_object
SnapIncrement
Methods
functions
FinishDrag
lock
OnBlur
functions
OnButtonTyped
functions
OnDeleted
lock
OnDragFinish
lock
OnDragMove
lock
OnDragStart
lock
OnMouseDown
lock
OnMouseMove
lock
OnMouseUp
functions
Tick
Handle
A draggable panel on a canvas. By default it positions itself in canvas coordinates, retaining its CSS size through zoom. Override the drag methods to edit other data instead.
class
Sandbox.UI.CanvasPanel
.
account_tree
extends
Panel
Sandbox.Engine
build
Constructors
1
Handle
(
)
data_object
Properties
12
Anchor
Vector2
Fraction of the panel size placed over Position. Defaults to its centre.
Canvas
CanvasPanel
The nearest containing canvas.
DragAxis
Axis
Current axis restriction, including any Shift lock.
DragEnabled
bool
Allow dragging with the left mouse button.
DragOrigin
Vector2
Position at the start of the drag, before constraints are applied.
IsDragging
bool
Whether this handle currently owns a drag.
LockAxisWithShift
bool
Holding Shift at the start locks to the dominant axis after four logical pixels.
MovementAxis
Axis
Restrict movement to one axis, or allow both.
MovementBounds
Nullable`1
Optional limits for the handle's position, in canvas coordinates.
Position
Vector2
Position in canvas coordinates. Direct canvas children retain their CSS size through zoom.
Positioned
bool
Position this panel automatically. Disable for a handle laid out inside another panel, such as a card heading.
SnapIncrement
Vector2
Snap positions to multiples of these increments. Zero disables snapping on that axis.
functions
Methods
11
FinishDrag
(
cancelled
)
End this handle's drag. Cancellation is also automatic on Escape, focus/capture loss or deletion.
OnBlur
(
e
)
OnButtonTyped
(
e
)
OnDeleted
(
)
OnDragFinish
(
cancelled
)
Finish editing, restoring the original position on cancellation.
OnDragMove
(
delta
)
Apply total movement from DragOrigin. Override to move other panels or edit a data model.
OnDragStart
(
e
)
bool
Accept a drag after performing item-specific selection or hit testing.
OnMouseDown
(
e
)
OnMouseMove
(
e
)
OnMouseUp
(
e
)
Tick
(
)
Inheritance
Panel
Handle
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.