First Spear Posted December 26, 2016 Share Posted December 26, 2016 Merry Christmas all! I am changing a part of the screen with the below code. I would like to change it but set the foreground color before I do, so when it renders all tiles come out at a specified color. How could that be done? Thanks. DEFINE 0,8,mybitmaps_0 Wait SCREEN my_cards,0,80,9,8,9 Quote Link to comment Share on other sites More sharing options...
catsfolly Posted December 26, 2016 Share Posted December 26, 2016 The "screen" command simply copies values from your data table (in your case "my_cards" ) to the backtab. Color information has to be included in the data table. If you want to change the color used, you could either: 1. have a different "my_cards" data table for each desired color. or 2. have no color in the data table, and then write a fixup routine to add the color later... DEFINE 0,8,mybitmaps_0 Wait SCREEN my_cards,0,80,9,8,9 #color = CS_WHITE for r = 0 to 8 #address = BACKTAB_ADRS + 80 + (20 * r) for c = 0 to 9 poke #address, peek(#address) + #color #address = #address + 1 next c next r Catsfolly 2 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted December 26, 2016 Share Posted December 26, 2016 I would make use of XOR if you want to fade in something e.g. Colour would become: #color=#fromColour XOR #toColour The central part of catsfolly's loop would become: #data=peek(#address) #data=#data XOR #color poke #address,#data #address=#address+1 Then you would make it into a procedure and call it as follows:- rem Fade fromblack to blue. #fromColour=CS_BLACK #toColour=CS_BLUE gosub FadeBlockIn wait ' Wait for a few VBLANKSs before altering the colour again. wait wait rem Fade from blue to white. #fromColour=CS_BLUE #toColour=CS_WHITE gosub FadeBlockIn wait wait wait rem Fade from white to green. #fromColour=CS_WHITE #toColour=CS_GREEN gosub FadeBlockIn wait wait wait Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.