Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clear ink from attr
#1
How do you use print to remove all ink from an attribute (8*8 square)

the opposite is 'print /::' to draw a block but i want to clear all ink away and leave the paper
Reply
#2
Just " " (space) or "/ " (with two spaces). But if you want only to clear Attr, use and PAPER 8, BRIGHT 8, maybe FLASH 8 and set INK to any colour you like. If you don't want to clear pixels use OVER 1.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#3
LCD Wrote:Just " " (space) or "/ " (with two spaces). But if you want only to clear Attr, use and PAPER 8, BRIGHT 8, maybe FLASH 8 and set INK to any colour you like. If you don't want to clear pixels use OVER 1.
There's also a SET_ATTR that, If recall correctly, also do that (e.g. SETATTR(x, y, attr)), but better try LCD's recommendation first. Libraries are ALPHA :mrgreen:
Reply
#4
SETATTR only for paper needs BAND function to work. I myself use pokes, especialy for the whole screen (768 bytes), but SATATTR is fast too. You will need ATTR to read the Attribute at given coordinate, then binary AND it with a mask (BIN 11000111) to get a value without paper. Then you can use a new paper if it is different than zero by binary OR-ing (BOR) it with Paper shifted to left 3 times ( newpaper<<3 ).
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#5
LCD Wrote:SETATTR only for paper needs BAND function to work. I myself use pokes, especialy for the whole screen (768 bytes), but SATATTR is fast too. You will need ATTR to read the Attribute at given coordinate, then binary AND it with a mask (BIN 11000111) to get a value without paper. Then you can use a new paper if it is different than zero by binary OR-ing (BOR) it with Paper shifted to left 3 times ( newpaper<<3 ).
BAND is already implemented as an operator! :!: It should be working since 1.2.6 (to say the least).
So
Code:
DIM a as Ubyte = 5
PRINT a bAND 1
Should work and PRINT just 1
Reply
#6
Code:
ink 0
DIM a as Ubyte = 5
PRINT at selecty,selectx;a bAND 1

this just prints black ones to the screen

Code:
ink0
PRINT at selecty,selectx;" "

this works Big Grin
Reply
#7
slenkar Wrote:
Code:
ink 0
DIM a as Ubyte = 5
PRINT at selecty,selectx;a bAND 1

this just prints black ones to the screen
And that's ok.
bAND is an OPERATOR. It calculates (a AND 1). The difference with normal AND is that, AND uses boolean logic (0 = False, any other value = True).
bAND is for BINARY (or BITWISE) operations (hence the 'b' Prefix). You have bAND, bOR, bXOR and bNOT.

For what you want, do as LCD suggested:
Code:
PRINT AT y, x; OVER 1; PAPER 8; INK value; " "
This should do the trick.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)