Jump to content

Search the Community

Showing results for tags 'canvasrenderingcontext2d'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. I am converting my BabylonJS project to Typescript. Having trouble with one conversion: With the following code: var planeTexture = new DynamicTexture('dynamic texture', 512, scene, true) let textureContext = planeTexture.getContext() planeTexture.getContext() calls this._canvas.getContext("2d") as you can see here (line 36 /src/Materials/Textures/babylon.dynamicTexture.ts). Returning actually one of these I am assuming: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D In BabylonJS, however, it looks like an interface with just a few properties (line 77: /src/babylon.mixins.ts). So, my problem is that my project won't compile if I want to call methods not in the mixin and I can't seem to cast to CanvasRenderingContext2D (since first property on CanvasRenderingContext2D 'canvas' is missing). I'd like to call save(), restore(), fillStyle, etc. It was working in javascript, but does anybody know how to do that in Typescript?
×
×
  • Create New...