Shop OBEX P1 Docs P2 Docs Learn Events
Propeller graphic_ddemo.spin example in ide — Parallax Forums

Propeller graphic_ddemo.spin example in ide

TransistorToasterTransistorToaster Posts: 149
edited 2006-12-23 04:36 in Propeller 1
GRAPHIC_DEMO>SPIN
Hello smile.gif,
I'd like to ask a few questions on the Propellor GRAHIC_DEMO.SPIN example for the graphics.spin engine.

1.
Near the beginning, a 64 element array is initialized:
repeat i from 0 to 63
colors := $00001010 * (i+4) & $F + $2B060C02

I found that the colors are stored as two bits and take only 4 values: correspond to black, white, blue, plus a color that changes from line to line in the graphics_demo.spin code. How is the block of code supposed to work?

2. Do tiles and raster graphics coexist, and if so, how do they? The code seems to talk about tiles and raster graphics, as evidenced by
A)
'init tile screen
repeat dx from 0 to tv_hc - 1
repeat dy from 0 to tv_vc - 1
screen[noparse][[/noparse]dy * tv_hc + dx] := display_base >> 6 + dy + dx * tv_vc + ((dy & $3F) << 10)

and
B)
gr.setup(16, 12, 128, 96, bitmap_base)

BUT, I see in the example the gr.text(-90,50,@numchr) statement which implies that the text is placed as pixels anywhere in the raster pixel 256 x 192 array.
So, how do the tiles work in graphics.spin? confused.gif

3. Are there any other good examples of spin code with raster graphics?
Thanks in advance,
Frank

Comments

Sign In or Register to comment.