EASy68K
http://www.easy68k.com/EASy68Kforum/

DRAW_STRING (task95) & PEN_COLOR (task 80)
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1575
Page 1 of 1

Author:  ABot [ Sun Jan 01, 2017 8:03 pm ]
Post subject:  DRAW_STRING (task95) & PEN_COLOR (task 80)

Hello,

I wanted to know how is it possible to set a PEN_COLOR (like blue) on a String (with task 95) ? Because I have a String, the background color is white, and I wanted to show the String with a blue color. But its not working. It seems like DRAW_STRING doesn't respect the pen color, only the fill color (task 81)... Any solution ? :/

Cordially

Author:  profkelly [ Tue Jan 03, 2017 6:45 pm ]
Post subject:  Re: DRAW_STRING (task95) & PEN_COLOR (task 80)

The font color is used by trap task #95.

Code:
*-----------------------------------------------------------
* Program Number: v1.0
* Written by    : Charles Kelly
* Date Created  : Jan-3-2017
* Description   : Draw text as graphic element.
*
*-----------------------------------------------------------
BLACK   EQU     $00000000
MAROON  EQU     $00000080
GREEN   EQU     $00008000
OLIVE   EQU     $00008080
NAVY    EQU     $00800000
PURPLE  EQU     $00800080
TEAL    EQU     $00808000
GRAY    EQU     $00808080
RED     EQU     $000000FF
LIME    EQU     $0000FF00
YELLOW  EQU     $0000FFFF
BLUE    EQU     $00FF0000
FUCHSIA EQU     $00FF00FF
AQUA    EQU     $00FFFF00
LTGRAY  EQU     $00C0C0C0
WHITE   EQU     $00FFFFFF

FONT    EQU     $01090000       Fixedsys, 9 point, normal

        ORG     $1000
****************************************
*           PROGRAM START             
START

*** draw text as graphics
        move.l  #YELLOW,d1              font color
        move.l  #FONT,d2                font name, size and style
        move.b  #21,d0
        trap    #15                     set font properties

        move.l  #100,d1                 X1
        move.l  #50,d2                  Y1
        lea     text,a1                 string to display
        move.b  #95,d0                  task 95, display text as graphic
        trap    #15

        move.l  #BLUE,d1                font color
        move.l  #FONT,d2                font name, size and style
        move.b  #21,d0
        trap    #15                     set font properties

        move.l  #100,d1                 X1
        move.l  #75,d2                  Y1
        lea     text,a1                 string to display
        move.b  #95,d0                  task 95, display text as graphic
        trap    #15


text    dc.b    'ABCDEFG',0
        END     START

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/