Documentation ¶
Index ¶
- Constants
- func AddEventListener(eventType string, callback func(Event))
- func RequestAnimationFrame(callback AnimationCallback) uint64
- type AnimationCallback
- type Context2d
- func (c *Context2d) Arc(x, y, radius, startAngle, endAngle float64, anticlockwise bool)
- func (c *Context2d) BeginPath()
- func (this Context2d) ClearRect(x, y, width, height float64)
- func (c *Context2d) ClosePath()
- func (c *Context2d) Fill()
- func (c *Context2d) FillRect(x, y, width, height float64)
- func (c *Context2d) FillText(text string, x, y float64)
- func (c *Context2d) LineTo(x, y float64)
- func (c *Context2d) MeasureText(text string) TextMetrics
- func (c *Context2d) MoveTo(x, y float64)
- func (c *Context2d) SetFillStyle(style string)
- func (c *Context2d) SetFont(font string)
- func (c *Context2d) SetLineWidth(width int)
- func (c *Context2d) SetStrokeStyle(style string)
- func (c *Context2d) Stroke()
- func (c *Context2d) StrokeRect(x, y, width, height float64)
- func (c *Context2d) StrokeText(text string, x, y float64)
- type Event
- type HtmlCanvasElement
- type HtmlElement
- type KeyboardEvent
- type MouseEvent
- type TextMetrics
Constants ¶
View Source
const ( KeyDownEvent = "keydown" KeyUpEvent = "keyup" KeyPressEvent = "keypress" MouseDownEvent = "mousedown" MouseUpEvent = "mouseup" MouseClickEvent = "click" MouseDblClickEvent = "dblclick" MouseMove = "mousemove" )
Variables ¶
This section is empty.
Functions ¶
func AddEventListener ¶
func RequestAnimationFrame ¶
func RequestAnimationFrame(callback AnimationCallback) uint64
Types ¶
type AnimationCallback ¶
type AnimationCallback = func(timestamp int)
type Context2d ¶
func (*Context2d) MeasureText ¶
func (c *Context2d) MeasureText(text string) TextMetrics
func (*Context2d) SetFillStyle ¶
func (*Context2d) SetLineWidth ¶
func (*Context2d) SetStrokeStyle ¶
func (*Context2d) StrokeRect ¶
func (*Context2d) StrokeText ¶
type HtmlCanvasElement ¶
type HtmlCanvasElement struct { HtmlElement // contains filtered or unexported fields }
func (HtmlCanvasElement) GetContext2d ¶
func (this HtmlCanvasElement) GetContext2d() *Context2d
type HtmlElement ¶
type HtmlElement struct {
// contains filtered or unexported fields
}
func GetElementById ¶
func GetElementById(id string) (*HtmlElement, error)
func (HtmlElement) AddEventListener ¶
func (e HtmlElement) AddEventListener(eventType string, callback func(Event))
func (HtmlElement) ToCanvas ¶
func (he HtmlElement) ToCanvas() HtmlCanvasElement
type KeyboardEvent ¶
type KeyboardEvent struct { EventType string AltKey bool CtrlKey bool ShiftKey bool MetaKey bool CharCode uint8 Code string Key string KeyCode int }
TODO: Add support for gestures
func KeyboardEventFromArgs ¶
func KeyboardEventFromArgs(args []js.Value) KeyboardEvent
type MouseEvent ¶
type MouseEvent struct { EventType string AltKey bool CtrlKey bool ShiftKey bool MetaKey bool Button int ClientX int ClientY int OffsetX int OffsetY int }
func MouseEventFromArgs ¶
func MouseEventFromArgs(args []js.Value) MouseEvent
type TextMetrics ¶
Click to show internal directories.
Click to hide internal directories.