Propeller graphic_ddemo.spin example in ide
TransistorToaster
Posts: 149
GRAPHIC_DEMO>SPIN
Hello ,
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
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?
3. Are there any other good examples of spin code with raster graphics?
Thanks in advance,
Frank
Hello ,
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
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?
3. Are there any other good examples of spin code with raster graphics?
Thanks in advance,
Frank
Comments
Check out my post. It should help make it easier.
http://forums.parallax.com/showthread.php?p=605448
Jim
Frank