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

rex_canvas_gradient

Plugin, ACE table, Discussion thread
Dependence: canvas plugin

Introduction
Fill gradient color at canvas object.

Usage
Sample capx
Prepare
Put this behavior under canvas object.
Steps
  1. Call "Action:Define line gradient" , or "Action:Define radius gradient", "Action:Define concentric circle gradient" to define the type of gradient.
  2. Call "Action:Define color stop" two or more times, to define the color of gradient.
  3. Actions under "Filled area" category like "Action:Define by left-top", or "Action:Define by center" are optional, use one of them to define the filled area of gradient.
  4. Finally, call "Action:Draw gradient" to fill the area with gradient colors.
Run from step1 to step4 for each gradient drawing.
Filled area
  • The default filled area of line gradient is whole canvas, user might need to re-define the filled area manually by calling "Action:Define filled area".
  • The default filled area of concentric circle gradient or radius gradient  is a minimum square to fit this circle, it dose not need to re-define the filled area usually.
Color stop
User need to define at least two or more color stops. One is the color at offset 0, the other is the color at offset 1. Or the color between offset 0 to 1.

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