Documentation ¶
Overview ¶
Package mechoverlayer dispenses HTML elements which overlay the scene associated with a particular shutterbug.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOverlayerHandleFunc ¶
func NewOverlayerHandleFunc( ovr Overlayer, shutterbugs mechshutterbug.Containser, ) http.HandlerFunc
NewOverlayerHandleFunc creates a HTTP request handler which allows clients to interface with the overlayer.
The handler upgrades the HTTP request to a websocket. The websocket's first ever incoming message should be a valid shutterbug.
func XToLeft ¶
XToLeft maps a screen space X coordinate to a CSS percentage value of the width of the screen's HTML element starting from the left edge of the screen.
The visible screen space spans X values given in the range
(-0.5 * screen ratio) ... (0.5 * screen ratio)
Types ¶
type Element ¶
type Element struct { // The element's HTML as a string. InnerHTML string // Hash of the innerHTML. InnerHTMLHash string // Orientation of the element. Transform, TransformOrigin string // (0.5 * screen ratio) is a point at the right edge of the screen, (-0.5 * // screen ratio) is the left edge of the screen. X float64 // 0.5 is a point at the top edge of the screen, -0.5 is the bottom edge of // the screen. Y float64 // Perpendicular distance from the camera's Z=0 plane, used to determine the // element's zIndex in the HTML document. Z float64 // contains filtered or unexported fields }
An Element in a HTML document overlaying a shutterbug's pixels screen.
type Elements ¶
Elements accessible by element name.
type Overlayer ¶
An Overlayer makes and updates HTML elements in overlays.
Each shutterbug is associated with an overlay: all clients using that shutterbug see the same overlay. In the browser the overlay's elements appear above the shutterbug's pixels screen.
func (Overlayer) RemoveShutterbug ¶
RemoveShutterbug from the overlayer and close the associated HTTP request handlers using that shutterbug.
If the shutterbug does not exist in the overlayer nothing happens.
func (Overlayer) Synchronise ¶
Synchronise the receiver overlayer's overlay elements with the given elements for the given shutterbug.
The given elements are the source of truth, and based on that the receiver creates, deletes, updates, and hides its elements as necessary.