atarionline.pl Transparent Graphics - Forum Atarum

Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.

  • :
  • :

Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.

    • 1: CommentAuthorPaladina
    • CommentTime15 Mar 2010
     
    Hello,

    ok I study little PMG and Graphics in TurboBasic, the PM use other memory place as Graphics memory and do not box overwriting, in this way Iam search for any DLI or other help.

    The problem if I have Graphics 24 of 31 (8 or 15) I load picture and need write there other picture or text. But it make box aronud pic or text and I need transparent it. Is there any good DLI or example in turbobasic ?

    my example
    A
    00000000
    000**000
    00****00
    00*00*00
    00****00
    00*00*00
    00*00*00
    00000000

    I need if I use TEXT 10,10,"A" in GR.24 that the 0 value become transparent to background loaded picture - DLI

    And in more help If I convert or load in Memory screen a picture, that I become the 0 value transparent too... any simply USR DLI or anything possible? thx.
    • 2:
       
      CommentAuthorKaz
    • CommentTime15 Mar 2010
     
    Dla nieangielskojezycznych, ktorzy chcieli by pomoc: facet chce w obrazek GR8 lub GR15 wklejac fragmenty innego obrazka albo wstawiac tekst, ale tak, zeby tlo tego nowego obrazka albo liter tekstu nie zamazywalo obrazka pod spodem, tylko sie na niego nakladalo. I nie wie, jak to zrobic.
    • 3: CommentAuthormono
    • CommentTime15 Mar 2010 zmieniony
     
    It is simple in GR.8 - it is enough to do ORA of snippet with existing screen:
    lda screen
    ora snippet
    sta screen

    In GR.15 requested operation is more difficult, because 1 pixel is represented by 2 bits in memory. You need mask screen graphics before ORA with your snippet for example:
    lda #0
    sta mask
    lda #%11
    loop:
    tax
    bit snippet
    bne nxt
    ora mask
    sta mask
    nxt:
    txa
    asl @
    asl @
    bne loop

    lda screen
    and mask
    ora snippet
    sta screen

    To optimize it you can use tables:
    ldx snippet
    lda mask,x
    and screen
    ora snippet
    sta screen
    ...
    mask:
    dta b(%11111111) ;0
    dta b(%11111100)
    dta b(%11111100)
    dta b(%11111100)
    dta b(%11110011) ;4
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11110011) ;8
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11110011) ;$c
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11110000)
    dta b(%11001111) ;$10
    dta b(%11001100)
    dta b(%11001100)
    dta b(%11001100)
    dta b(%11000011) ;$14
    dta b(%11000000)
    dta b(%11000000)
    dta b(%11000000)
    ...
    dta b(%00000011) ;$fc
    dta b(%00000000)
    dta b(%00000000)
    dta b(%00000000)

    That's all :)
    P.S. This code explains only idea - it's unusable as is.
    • 4: CommentAuthorPaladina
    • CommentTime15 Mar 2010
     
    Its nice in asm, but I need it in Turbobasic as DLInterupt or else... thanks for help, guys :D
    • 5:
       
      CommentAuthorjhusak
    • CommentTime13 Apr 2010 zmieniony
     
    Sorry, no plain solution. Atari has only one playfield unlike Amiga or other playmachines.

    The only solution is as mono presented. In asm it will work fast, but you can try it in TB.

    Three ways:
    - You simply do "or" boole function on the background and boxed picture. But this leads to funny effects (like transparency-like mix)

    - you do the mask (which will be "and"ed with the background) - you cut-off the shape of the boxed picture using this mask. you create the mask on the fly, next you do the former point ("or").

    - you define boxed picture and the mask. Then when you want to put byte , you have to get background byte, and it with the corresponding byte in the mask, or it with corresponding byte in the boxed pic, and store it again in the background.

    This is the only way unless you can manage to do it on the pm graphics (because your picture is narrow or it has only one colour)

    DLI is to change colors in the whole line (in most cases), change hscroll, change position of pm object, and so on. It has nothing to combine pictures.