Flip back how color is done.
This commit is contained in:
@ -30,8 +30,8 @@ grf
|
|||||||
." CHAR: " last-char . cr
|
." CHAR: " last-char . cr
|
||||||
then
|
then
|
||||||
)
|
)
|
||||||
0 color! 0 0 width height box
|
0 to color 0 0 width height box
|
||||||
LEFT-BUTTON pressed? if $ccccff else $ffccff then color!
|
LEFT-BUTTON pressed? if $ccccff else $ffccff then to color
|
||||||
mouse-x mouse-y height heart
|
mouse-x mouse-y height heart
|
||||||
flip
|
flip
|
||||||
event FINISHED = until
|
event FINISHED = until
|
||||||
|
|||||||
@ -14,35 +14,33 @@
|
|||||||
|
|
||||||
( Graphics Utilities )
|
( Graphics Utilities )
|
||||||
\ Pen:
|
\ Pen:
|
||||||
\ color! ( col -- )
|
\ ( $rrggbb ) to color
|
||||||
\ Drawing:
|
\ Drawing:
|
||||||
\ box ( x y w h -- )
|
\ box ( x y w h -- )
|
||||||
|
|
||||||
also internals
|
also internals
|
||||||
grf definitions
|
grf definitions
|
||||||
|
|
||||||
|
0 value color
|
||||||
|
|
||||||
internals definitions
|
internals definitions
|
||||||
|
|
||||||
variable color
|
|
||||||
|
|
||||||
( Scale to be divided by $10000 )
|
( Scale to be divided by $10000 )
|
||||||
variable sx variable sy
|
$10000 value sx $10000 value sy
|
||||||
$10000 sx ! $10000 sy !
|
|
||||||
( Translation )
|
( Translation )
|
||||||
variable tx variable ty
|
0 value tx 0 value ty
|
||||||
|
|
||||||
: hline { x y w }
|
: hline { x y w }
|
||||||
\ x y pixel w 1- for color @ over l! 4 + next drop ;
|
\ x y pixel w 1- for color over l! 4 + next drop ;
|
||||||
x y pixel w color @ fill32 ;
|
x y pixel w color fill32 ;
|
||||||
|
|
||||||
grf definitions also internals
|
grf definitions also internals
|
||||||
|
|
||||||
: color! ( col -- ) color ! ;
|
|
||||||
|
|
||||||
: box { left top w h }
|
: box { left top w h }
|
||||||
left sx @ * tx @ + 16 rshift to left
|
left sx * tx + 16 rshift to left
|
||||||
top sy @ * ty @ + 16 rshift to top
|
top sy * ty + 16 rshift to top
|
||||||
w sx @ * 16 rshift to w
|
w sx * 16 rshift to w
|
||||||
h sy @ * 16 rshift to h
|
h sy * 16 rshift to h
|
||||||
|
|
||||||
left w + top h + { right bottom }
|
left w + top h + { right bottom }
|
||||||
left 0 max to left
|
left 0 max to left
|
||||||
|
|||||||
@ -72,22 +72,22 @@ create arrow-table
|
|||||||
|
|
||||||
: draw-one { e } e ->kind @ { kind }
|
: draw-one { e } e ->kind @ { kind }
|
||||||
HEART-GOAL kind = if
|
HEART-GOAL kind = if
|
||||||
$ff0000 128 random dup 8 lshift + + color!
|
$ff0000 128 random dup 8 lshift + + to color
|
||||||
e ->x @ 100 / e ->y @ 100 / e ->step @ heart
|
e ->x @ 100 / e ->y @ 100 / e ->step @ heart
|
||||||
exit
|
exit
|
||||||
then
|
then
|
||||||
FIRE kind = if
|
FIRE kind = if
|
||||||
$222222 color!
|
$222222 to color
|
||||||
e ->x @ 100 / 4 - e ->y @ 100 / 4 - 8 8 box
|
e ->x @ 100 / 4 - e ->y @ 100 / 4 - 8 8 box
|
||||||
exit
|
exit
|
||||||
then
|
then
|
||||||
SPARK kind = if
|
SPARK kind = if
|
||||||
$ff7700 128 random 8 lshift + color!
|
$ff7700 128 random 8 lshift + to color
|
||||||
e ->x @ 100 / 4 - e ->y @ 100 / 4 - 8 8 box
|
e ->x @ 100 / 4 - e ->y @ 100 / 4 - 8 8 box
|
||||||
exit
|
exit
|
||||||
then
|
then
|
||||||
ARROW kind = if
|
ARROW kind = if
|
||||||
$ffff00 256 random + color!
|
$ffff00 256 random + to color
|
||||||
39 for
|
39 for
|
||||||
e ->x @ 100 / e ->vx @ i 200 */ + i arrow-- 2/ -
|
e ->x @ 100 / e ->vx @ i 200 */ + i arrow-- 2/ -
|
||||||
e ->y @ 100 / e ->vy @ i 200 */ + i arrow-- 2/ -
|
e ->y @ 100 / e ->vy @ i 200 */ + i arrow-- 2/ -
|
||||||
@ -99,16 +99,16 @@ create arrow-table
|
|||||||
|
|
||||||
: volcano
|
: volcano
|
||||||
height 2/ for
|
height 2/ for
|
||||||
$334400 i 100 height */ + color!
|
$334400 i 100 height */ + to color
|
||||||
width 2/ i 2/ - i height 2/ + i height 8 / + 1 box
|
width 2/ i 2/ - i height 2/ + i height 8 / + 1 box
|
||||||
next
|
next
|
||||||
0 color!
|
0 to color
|
||||||
width 2/ height 2/
|
width 2/ height 2/
|
||||||
height 8 / 20 box
|
height 8 / 20 box
|
||||||
;
|
;
|
||||||
|
|
||||||
: draw
|
: draw
|
||||||
$003300 color! 0 0 width height box
|
$003300 to color 0 0 width height box
|
||||||
volcano
|
volcano
|
||||||
entity-count 0 ?do i entity draw-one loop
|
entity-count 0 ?do i entity draw-one loop
|
||||||
flip
|
flip
|
||||||
|
|||||||
Reference in New Issue
Block a user