LoginLogin

SmileBASIC 4 Discussion「プチコン4」

Root / General / [.]

📌
MZ952Created:
Text background color doesn't exist anymore. The best solution is probably to put a sprite behind the text and scale it up so each pixel takes up 1 character cell, and draw on that.

Is there a way to set the text background color (for each character)?
Nope.
My second question is about GPAGE. It appears that it is gone, is that right?
The graphics screen is just a sprite now, sprite 4095 or #GSPRITE. So, you just have to change which GRP that sprite is using with SPPAGE.
'SB3
GPAGE a,b

'SB4
SPPAGE #GSPRITE,a
GTARGET b

My second question is about GPAGE. It appears that it is gone, is that right?
The graphics screen is just a sprite now, sprite 4095 or #GSPRITE. So, you just have to change which GRP that sprite is using with SPPAGE.
'SB3
GPAGE a,b

'SB4
SPPAGE #GSPRITE,a
GTARGET b
Cool

What are the advantages of having the graphics screen now be a sprite?

What are the advantages of having the graphics screen now be a sprite?
Among other things, Sprite functions. Correct me if I'm wrong, but I suspect it'd work with SPANIM and SPCOLOR now.

Yeah, all sprite functions work. It really is just a regular sprite now. There are only two things special about #GSPRITE: 1. How it gets initialized when you run ACLS or XSCREEN:
'SCRWxSCRH is the size of the screen
SPSET #GSPRITE,0,0,SCRW,SCRH
SPPAGE #GSPRITE,0
SPLAYER #GSPRITE,0
SPOFS #GSPRITE,0,0,4095
2. SPCLR without any arguments clears sprites 0-4094. You can still do SPCLR #GSPRITE, though. Aside from these two things, it's a completely normal sprite, and you can use it as one if you want. As for why they did this, it's because sprites could already do everything the graphics screen could in SB3, with one exception: being able to pick a GRP for each individual sprite. Now that we can do that in SB4, there's no reason to keep the graphics screen around, since it'd just be a worse sprite. There were similar reasons to merge BGs and the text screen, since the text screen was basically just a worse BG. In that case, though, we did lose background colors, but I think it's a decent trade, since it's not tough to simulate. In general, I think these changes have made the language a lot cleaner conceptually when it comes to graphics. At the same time, it may be harder to understand.

I used 3rd text layer as background color. (CLS will not clear BG layer #3. use CLS 3 to clear background color layer)
TSCREEN 8,8 'default console is #4 and front of 0-3 text layers.
TSCREEN 3,8,8 'BG layer #3. used as background color of font

'layer 3
COLOR 3,#C_RED
LOCATE 3,5,5
TPRINT 3,CHR$(&HE297)*3 'filled square

'console layer
COLOR #C_WHITE
LOCATE 5,5
PRINT "Red"

Hi, I tried out SPPAGE and GTARGET, and it works as desired. Not sure if I got any increase in frame rate or not, but I am glad for the help. It should be faster even if I hadn't noticed it in my Pythagoras Tree implementation. I am quite sad about losing the text background color. I was thinking of maybe having an extra text screen underneath with colored solid block characters, but that is a bit clunky. I do tend to like to make the Turbo Vision-esque user interfaces in text. In fact my first game for Smile Basic, "Bug Squish", had one on the top screen. I was actually stock-piling Fractals and was going to make something like the text GUIs below for the main menu in main.prg (I ported over my code for the Barnsley Fern last night). Here are some examples of Turbo Vision or text GUIs from back in the day. Things like that will be more ackward now. Probably simpler to draw it out as graphics at this point. Maybe I need to work on that button library again.

Just make a function to fill background colors automatically.

If I had a Switch, I wouldn't really care about losing text backgrounds tbh. That is because I rarely use them lol.

SmileBASIC4 is updated to 4.0.2 and DEFGRP is updated too.

SmileBASIC4 is updated to 4.0.2 and DEFGRP is updated too.
What’s different about it? Did anything else change in this update?

Some tiles were missing.

Here's the changes to DEFGRP: One of the face sprites was moved over a bit. Alpha was fixed for these sprites. Some tiles were added, and the tiles for these plants were moved over a bit. Aside from that, there were a ton of bugfixes in 4.0.2. You can see the list here: https://sup4.smilebasic.com/doku.php?id=debug

How do I make a file copier that copies all the files from the # projects?

How do I make a file copier that copies all the files from the # projects?
42K3E2KAE Download this one I just made and see how it works. It copies the files from all three system projects into the current working one, so you probably want to make a new folder. Any .PNG type GRP can't be copied because a bug prevents me from checking its dimensions; you'll have to copy them manually from the filemenu.

Finally bought SB4.

How do I make a file copier that copies all the files from the # projects?
42K3E2KAE Download this one I just made and see how it works. It copies the files from all three system projects into the current working one, so you probably want to make a new folder. Any .PNG type GRP can't be copied because a bug prevents me from checking its dimensions; you'll have to copy them manually from the filemenu.
Thanks so much! I already made my own, but I forgot to update my post I know, I’m dumb How come you needed to check the dimensions? I just did LOADG "INSERT FILE WITH PATH HERE",0, then I did SAVEG "INSERT FILE WITHOUT PATH HERE",0. It copied every file without problems.

That won't work if the file isn't the default size though

That won't work if the file isn't the default size though
It worked for me. It seemed to save everything. Maybe I’m wrong and some of the parts from the PNG files got cut off?