Help with Text Box Overlapping HUD Box

tbizzle

Well-known member
I have it where my text box overlaps my HUD box. After I trigger a text on a screen, the HUD will not restore. Is there a way to restore the HUD after the text plays out?
 

baardbi

Well-known member
I have it where my text box overlaps my HUD box. After I trigger a text on a screen, the HUD will not restore. Is there a way to restore the HUD after the text plays out?
The problem is that the text box restores the tiles that were beneath the text box area. And those tiles are fetched from the screen layout. So basically it doesn't know about the HUD tiles that were there. It just replaces them with the tiles you put there when designing the screen. I'm sure there is some trickery you could do to fix that, but it would require some advanced coding. I guess the best workaround is to not have the text box area overlap the HUD.
 

kevin81

Well-known member
I am probably way too optimistic and missing something crucial thinking this might be a solution XD

Code:
    LDX #$03 ;; One less than the number of HUD elements you're using
    -updateHudLoop:
        LDA ValToBitTable_inverse,x
        STA hudUpdates
        JSR doWaitFrame
        DEX
    BNE -updateHudLoop
 

tbizzle

Well-known member
I didn't know where exactly to insert the code, but right here is where it wasn't broken right off the bat. Still didn't restore the HUD tiles.
Code:
LDA screenType
    CMP #$01
    BNE oohYeah
        RTS
        oohYeah:
    SwitchBank #$18
        JSR doDrawHud_bank18
        ;JSR doDrawSpriteHud_bank18
    ReturnBank
            
        
        
    ; ;;; DrawTilesDirect macro is good for:
    ; ;;; Drawing static text
    ; ;;; Drawing an image.
    ; ;;; Arguments are:
        ; ;; bank, string/label, x compared to box0, y compared to box0, and offset of tiles being drawn (#HUD_OFFSET for hud stuff, 0 otherwise).
        ;DrawTilesDirect #$00, HUD_Health, #$02, #$02, #HUD_OFFSET
    
    ; ;;; Draw variable tiles is good for drawing a "bar" or "meter"
    ; ;; Draws a "max value" with one particular tile id
    ; ;; and a variable level with another tile id.
    
    ; ;DrawVariableTiles x, y, full length, tile, fill amount, tile.
    ; ; changes are the "amount" will be a variable, like my health or my magic or something.
    ; DrawVariableTiles #$10, #$02, #$08, #$C0, #$04, #$D0
    
    ; ;;; Draw numbers is good for drawing the value of a variable.  For drawing static, should stll use draw tiles direct.
    ; ;;; DrawNumbers root variable, number of places.
    ;DrawNumber #$02, #$04, myAmmo, #$04
    
        
    LDA gameHandler
    AND #%00100000
    BEQ doDrawHudUpdates
        JMP skipHudUpdates
    doDrawHudUpdates
    .include GameData\HUD_INCLUDES.dat
    LDX #$07 ;; One less than the number of HUD elements you're using
    -updateHudLoop:
    LDA ValToBitTable_inverse,x
    STA hudUpdates
    JSR doWaitFrame
    DEX
    BNE -updateHudLoop
    skipHudUpdates:
 
Top Bottom