Shop OBEX P1 Docs P2 Docs Learn Events
Question about VGA Graphics ASM — Parallax Forums

Question about VGA Graphics ASM

El PaisaEl Paisa Posts: 375
edited 2007-05-01 02:18 in Propeller 1
In the shapes, box and boxfill how I change the writing color?
The only color I got is white.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-04-30 18:16
    El Paisa,

    if you look at the 'color' command in the form of a BINARY number...

    gr.color(i,%RRGGBBxx_RRGGBBxx)

    ...The upper BYTE is the foreground (pixel color), while the lower BYTE is the background.

    Each RGB place holder represents two bits, resulting in a total of 4 color shades for each R, G, and B.


    Example:

    gr.color(i,%11000000_00000000) ' Bright Red on Black
    gr.color(i,%00110000_00000000) ' Bright Green on Black
    gr.color(i,%11110000_00001100) ' Bright Yellow on Blue

    Note:
    'i' represents the tile number

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • El PaisaEl Paisa Posts: 375
    edited 2007-04-30 18:35
    Beau,

    That part understand.

    What I want is able to change color to draw like lines, shapes, etc NOT tiles.
  • El PaisaEl Paisa Posts: 375
    edited 2007-04-30 18:51
    Looking at the VGA_graphics ASM, looks like there are not way to change colors except the tile color, right?

    I would like to change writing colors to draw boxes,shapes, text, etc.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-04-30 20:22
    El Paisa,

    I'm not sure I understand your question. Each Tile can only support 2 colors.... a foreground color which is what you plot with lines, boxes, shapes, text, etc. and a background color.


    To draw Bright Red lines, boxes, shapes, text, etc. on a Black background...
    gr.color(i,%11000000_00000000) ' Bright Red on Black

    To draw Bright Green lines, boxes, shapes, text, etc. on a Black background...
    gr.color(i,%00110000_00000000) ' Bright Green on Black

    To draw Bright Yellow lines, boxes, shapes, text, etc. on a Blue background...
    gr.color(i,%11110000_00001100) ' Bright Yellow on Blue


    again 'i' specifies which tile you want to configure


    gr.color(i,%rrggbbxx_rrggbbxx)
                |||||||| ||||||||
                |||||||| ||||||oo-NotUsed 
                |||||||| ||||||
                |||||||| ||||oo------Blue(00,01,10,11)--background
                |||||||| |||| 
                |||||||| ||oo-------Green(00,01,10,11)--background
                |||||||| ||
                |||||||| oo-----------Red(00,01,10,11)--background
                ||||||||
                ||||||oo----------NotUsed
                ||||||
                ||||oo---------------Blue(00,01,10,11)--foreground
                ||||
                ||oo----------------Green(00,01,10,11)--foreground
                || 
                oo--------------------Red(00,01,10,11)--foreground
                                           |  |  |  |             
                                           |  |  |  High Intensity
                                           |  |  |
                                           |  |  Medium Intensity
                                           |  |
                                           |  Low Intensity
                                           |
                                           Off
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/30/2007 8:39:53 PM GMT
  • El PaisaEl Paisa Posts: 375
    edited 2007-05-01 02:10
    This does not tell me how to change the foregrouind color only the background.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-05-01 02:18
    El Paisa,

    "This does not tell me how to change the foregrouind color only the background."

    Please take a closer look, it tells you how to change both foreground colors and background colors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.