AbstractHTMLDisplay class abstract

Abstract class to display in the html

Inheritance
Implementers

Constructors

AbstractHTMLDisplay({required Element container})
Create the canvas in the container

Properties

camera Camera
The camera is bound to the display with bindCamera.
getter/setter pairinherited
canvas CanvasElement
The CanvasElement, an html canvas;
getter/setter pair
container Element
getter/setter pair
darkMode bool
When darkMode is set to true, all the colors are updated: their brightness is inverted but the hue doesn't change
getter/setter pairinherited
dragCurrentPosition Vector3
As described in createMouseDraggedEvent, dragCurrentPosition is the position of the cursor at the time of the event
getter/setter pair
dragStartPosition Vector3
As described in createMouseDraggedEvent, dragStartPositon is the position of the cursor when the drag started
getter/setter pair
eventListeners List<StreamSubscription>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isDragging bool
As described in createMouseDraggedEvent, isDragging is set to true when the canvas receive the drag event
getter/setter pair
mouseButton MouseButton
mouseButton is the button who triggered the mouse event.
getter/setter pair
mousePosition Vector3
getter/setter pair
previousTimeStep double
getter/setter pair
prevMousePosition Vector3
getter/setter pair
renderer AbstractRenderer
The renderer is responsible for rendering mobjects (Mobject). It is created with createRenderer and is called from the constructor.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyColorTransformation(Color color) Color
Apply the darkMode if set to true otherwise return the color
inherited
bindCamera(Camera camera) → void
Binds the camera
inherited
bindEventListeners() → void
Binds all the eventListeners All the events should be converted to Event and sent to the onEvent method This method needs to be implemented in subclasses
override
createKeyPressedEvent(String keyPressed) → void
createKeyReleasedEvent(String keyReleased) → void
createMouseDraggedEvent() → void
Creates a MouseDraggedEvent
createMouseMovedEvent() → void
createMousePressedEvent() → void
createMouseReleasedEvent() → void
createRenderer() AbstractRenderer
Creates a renderer (AbstractRenderer) used to render mobjects (Mobject). This method needs to be implemented in subclasses
inherited
getCoordinates(double pixelX, double pixelY) Vector3
Converts the pixel coordinates (pixelX, pixelY) to the manim coordinates The result is returned as a Vector3, but used as a vector2 containing the coordinates x and y of the corresponding point @param pixelX from 0 to pixel width @param pixelY from 0 to pixel height
inherited
getMouseScreenPosition(Point<num> pt) Vector3
Get the position of the point pt in the canvas instead of the whole html document.
getPixelPosition(Vector3 coords) List<double>
Converts the manim coordinates (Vector3 coords) to the pixel coordinates The z component of coords is ignored. It returns a list of 2 double containing the x and y pixel coordinates
inherited
nextFrame() Future<double>
Waits for the next frame. Returns a Future containing the time elapsed between frames (in seconds) This method needs to be implemented in subclasses
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onEvent(Event event) → void
Dispatches the event to the corresponding EventListener by using the EventDispatcher
inherited
setDisplaySize(int width, int height) → void
Sets the width and the height of the canvas
override
setup() → void
inherited
toString() String
A string representation of this object.
inherited
unbindEventListeners() → void
Unbinds all the eventListeners This method needs to be implemented in subclasses
override

Operators

operator ==(Object other) bool
The equality operator.
inherited