Object/Class

io.scalajs.dom.html.phaser

Canvas

Related Docs: class Canvas | package phaser

Permalink

object Canvas extends Object

Canvas Singleton

Annotations
@native() @JSGlobal( "Phaser.Canvas" )
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Canvas
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addToDOM(canvas: HTMLCanvasElement, parent: |[String, HTMLElement], overflowHidden: Boolean = js.native): HTMLCanvasElement

    Permalink

    Adds the given canvas element to the DOM.

    Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent. If no parent is given it will be added as a child of the document.body.

    canvas

    The canvas to be added to the DOM.

    parent

    The DOM element to add the canvas to.

    overflowHidden

    If set to true it will add the overflow='hidden' style to the parent DOM element.

    returns

    Returns the source canvas.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def create(parent: Any, width: Int = js.native, height: Int = js.native, id: String = js.native, skipPool: Boolean = js.native): HTMLCanvasElement

    Permalink

    Creates a canvas DOM element.

    Creates a canvas DOM element. The element is not automatically added to the document.

    parent

    The object that will own the canvas that is created.

    width

    The width of the canvas element.

    height

    The height of the canvas element.

    id

    If specified, and not the empty string, this will be set as the ID of the canvas element. Otherwise no ID will be set.

    skipPool

    If true the canvas will not be placed in the CanvasPool global.

    returns

    The newly created canvas element.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getSmoothingEnabled(context: CanvasRenderingContext2D): Boolean

    Permalink

    Returns true if the given context has image smoothing enabled, otherwise returns false.

    Returns true if the given context has image smoothing enabled, otherwise returns false.

    context

    The context to check for smoothing on.

    returns

    True if the given context has image smoothing enabled, otherwise false.¬

  13. def getSmoothingPrefix(context: CanvasRenderingContext2D): String

    Permalink

    Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set.

    Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set.

    context

    The context to enable or disable the image smoothing on.

    returns

    Returns the smoothingEnabled vendor prefix, or null if not set on the context.

  14. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  22. def removeFromDOM(canvas: HTMLCanvasElement): Unit

    Permalink

    Removes the given canvas element from the DOM.

    Removes the given canvas element from the DOM.

    canvas

    The canvas to be removed from the DOM.

  23. def setBackgroundColor(canvas: HTMLCanvasElement, color: String): HTMLCanvasElement

    Permalink

    Sets the background color behind the canvas.

    Sets the background color behind the canvas. This changes the canvas style property.

    canvas

    The canvas to set the background color on.

    color

    The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.

    returns

    the source canvas.

  24. def setImageRenderingBicubic(canvas: HTMLCanvasElement): HTMLCanvasElement

    Permalink

    Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').

    Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto'). Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.

    canvas

    The canvas to set image-rendering bicubic on.

    returns

    the source canvas.

  25. def setImageRenderingCrisp(canvas: HTMLCanvasElement): HTMLCanvasElement

    Permalink

    Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).

    Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit). Note that if this doesn't given the desired result then see the setSmoothingEnabled.

    canvas

    The canvas to set image-rendering crisp on.

    returns

    the source canvas.

  26. def setSmoothingEnabled(context: CanvasRenderingContext2D, value: Boolean): CanvasRenderingContext2D

    Permalink

    Sets the Image Smoothing property on the given context.

    Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. By default browsers have image smoothing enabled, which isn't always what you visually want, especially when using pixel art in a game. Note that this sets the property on the context itself, so that any image drawn to the context will be affected. This sets the property across all current browsers but support is patchy on earlier browsers, especially on mobile.

    context

    The context to enable or disable the image smoothing on.

    value

    If set to true it will enable image smoothing, false will disable it.

    returns

    the source context.

  27. def setTouchAction(canvas: HTMLCanvasElement, value: String = js.native): HTMLCanvasElement

    Permalink

    Sets the touch-action property on the canvas style.

    Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.

    canvas

    The canvas to set the touch action on.

    value

    The touch action to set. Defaults to 'none'.

    returns

    The source canvas.

  28. def setTransform(context: CanvasRenderingContext2D, translateX: Double, translateY: Double, scaleX: Double, scaleY: Double, skewX: Double, skewY: Double): CanvasRenderingContext2D

    Permalink

    Sets the transform of the given canvas to the matrix values provided.

    Sets the transform of the given canvas to the matrix values provided.

    context

    The context to set the transform on.

    translateX

    The value to translate horizontally by.

    translateY

    The value to translate vertically by.

    scaleX

    The value to scale horizontally by.

    scaleY

    The value to scale vertically by.

    skewX

    The value to skew horizontally by.

    skewY

    The value to skew vertically by.

    returns

    the source context.

  29. def setUserSelect(canvas: HTMLCanvasElement, value: String = js.native): HTMLCanvasElement

    Permalink

    Sets the user-select property on the canvas style.

    Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.

    canvas

    The canvas to set the touch action on.

    value

    The touch action to set. Defaults to 'none'.

    returns

    The source canvas.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped