|
Post by matalog on Jul 11, 2017 16:02:46 GMT -5
How do you control which palette is used at the time of drawing?
Look at this for example:
pallettes GNDPAL,1,0,16 'load the color palette LOADTILES gndtop,1,325 bgcolor 1,4 for x=1 to 28 drawtile 325,x,15 next GNDPAL:
DATAINT $008E,$008E,$008E,$008E,$0EEE,$00E0,$0E00,$0888 ' Pallette: 1 DATAINT $0CCC,$0088,$0808,$0008,$0880,$0080,$0080,$0088 GNDTOP:
DATALONG $00000000 ' Tile: 0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $00000000
Why does that not draw tiles with an orange border and dark green inner on a white background?
If you want to switch palette during a program, how do you do that?
Thanks for any help,
matalog.
|
|
|
Post by wraith on Jul 11, 2017 16:44:00 GMT -5
Default is palette 0 , assign palette to tiles with +palette(#).
"drawtile 325+palette(1),x,15"
Ink also controls the palette so an "INK 1" before your draw routine will yield the same effect.
|
|
|
Post by matalog on Jul 11, 2017 18:49:03 GMT -5
Thanks for replying, I can still not get it to work for me. Can you see why this does not draw an orange border around a dark green tile?
Palettes pal,0,0,16 Palettes GNDPAL,1,0,16 'load the color palette LOADTILES gndtop,1,325 bgcolor 0,0 for x=1 to 23 DRAWTILE 325+palette(1),x,15 next pal: DATAINT $0EEE,$00EE,$0C66,$000E,$0E80,$0E40,$0E00,$0888 ' Palette: 0 DATAINT $0CCC,$0088,$0808,$0008,$0880,$0080,$0800,$0000 GNDPAL:
DATAINT $008E,$00EE,$0E0E,$000E,$0EE0,$00E0,$0E00,$0888 ' Palette: 1 DATAINT $0CCC,$0088,$0808,$0008,$0880,$0080,$0800,$0000
GNDTOP:
DATALONG $00000000 ' Tile: 0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $0DDDDDD0 DATALONG $00000000
|
|
|
Post by wraith on Jul 11, 2017 20:58:13 GMT -5
Simple, you've set Orange as Palette 1 Color 0.
4 palettes, 16 colors each, first entry (color 0) masking/transparent.
Default BGColor (palette 0 color 0) is displayed regardless.
Try commenting out "Palettes pal,0,0,16", set GNDPAL to 0, and remove +palette(1). This should render the BGColor Orange.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 12, 2017 6:35:20 GMT -5
The most tricky thing to remember is the first color entry properties. On palette 0, it sets the backdrop color, and on every other palette, it's the transparent color.
|
|