Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_canvasext

Plugin, ACE table, Discussion thread
Dependence: canvas plugin

Introduction
Extension of canvas plugin.

Usage
Load image from URL
Sample capx
Call "Action:Load image from URL" to load image from url, "Condition:On image URL loaded" will be triggered while loading finished.
Compare with sprite object
Sprite object has the same feature, too. But it will replace the image of frame for all sprite instances. The loading image of this behavior will affect only this canvas instance.

Erase
Sample capx
"
Action:Erase object" could erase canvas by shape of object.

Shadow
Sample capx
"
Action:Set shadow" could add a shadow to next drawing actions. Set shadow to default value ( offset = (0, 0). blur = 0, color = "black" to disable the shadow.

Run javascript code
Sample capx
Call "
Action:Eval" to draw by javascript code on "ctx" variable. The drawing api of canvas could be found in this page.
For example, these code could draw a box.

    
Advance sample capx

Override original saving/loading
Sample capx
Set property "Override SL" to "Zlib" to override original saving/loading functions defined in canvas plugin by zlib saving/loading. It could decrease output size very much.
Or get saving zlib string by "Expression:AsJSON", then load image back by "Action:Load". (Sample capx)

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About