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

rex_logicmask

Plugin, ACE table, Discussion thread
Dependence:
  • Option : One of them - rex_board_squareTx , rex_board_hexTx

Introduction
A logic area to test which tiles had been entered coverage, or had been exited coverage.
It could be used to maintain a very large board by only display part of tiles which are in masked area.

Usage
s

Sample capx
Concept
User define a mask, then put it to a logic board. Move this mask and get
entered coverage, or
exited coverage, or current coverage.
Define mask
There are some methods to fill the mask.
Each mask point has a relative logic position and carries a value.
  • Action:Fill a rectangle
  • Action:Fill a point
  • Action:Flood fill ( it needs one of these layout object - rex_board_squareTx , rex_board_hexTx)
  • Action:Clean a point
  • Action:Clean
Put mask
Call "
Action:Put mask" to put this mask to a logic board at a logic position, this action will move the mask to a new position. Then calculate  an entered area and an exited area by -
Entered area = Current_logic_coverage  -  Previous_logic_coverage
(
the area which did not in previous coverage, but in current coverage )

Exited area = Previous_logic_coverage  -   Current_logic_coverage
(
the area which in previous coverage, but not in current coverage )
Use
  • Condition:For each entered LXY
  • Condition:For each exit LXY
  • Condition:For each masked LXY
to pick each entered/exited/current masked logic position by these expressions:
Logic position : ( Expression:CurLX, Expression:CurLY )
Carried mask value :
Expression:CurValue
( Expression:OX , Expression:OY ) is the origin logic point.
"
Condition:In mask area" could be used to test if a logic position is in masked area.

Example
To fill a rectangle at Left-top X , Y to (-1, -1) and Width to 3, Height to 3. The mask will become
(-1, -1)    (0, -1)    (1, -1)
(-1,  0)    (0,  0)    (1,  0)

(-1,  1)    (0,  1)    (1,  1)

Then put this mask to logic position (50, 50) , the coverage area will become
(49, 49)    (50, 49)    (51, 49)
(49, 50)    (50, 50)    (51, 50)
(49, 51)    (50, 51)    (51, 51)
All these coverage logic position are entered area.
Put this mask to
logic position (51, 50) , the coverage area will become
(50, 49)    (51, 49)    (52, 49)
(50, 50)    (51, 50)    (52, 50)
(50, 51)    (51, 51)    (52, 51)
The entered area are -
(52, 49) , (52, 50) , (52, 51)
The exited area are -
(49, 49) , (49, 50) , (49, 51)

More samples
Using logic mask with rex_board
Move on a very large board

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