Hmm, I found the images and discovered that it did indeed capture the red!
I moved the image over to the default media folder, but it still won't show up. I got rid of all the lines of code that reset the clear color and now am only loading the image. This is my code:
// set window properties
SetWindowTitle( "Breakout" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
// create sprites from images
CreateSprite ( 1, LoadImage ( "red.png" ) )
SetSpriteSize( 1, 32, 32 )
Sync()
do
Print( Round(ScreenFPS()) )
Sync()
loop
Once again, all I see on the screen is black. I know the file is there but nothing is drawing, not even the "no sprite" image I was originally getting.
I don't know why this is so hard to get working, what am I doing wrong? Or is THIS now a bug whereas the last one was just misinformation?
EDIT: OK now I think this is a bug for sure. The thumbnail for the image shows as red but when I opened the image into GIMP there was nothing contained in the image file. It wouldn't display anything.
So it does appear to be a bug after all... well at least I know it wasn't my code. I guess I will just have to stick to using media after all...
EDIT 2: AHHA! eureka!
Instead of using SetClearColor(), I used DrawBox() to draw a basic blue box to see if that was maybe the culprit. That appears to have solved the problem!
Looks like I can make a medialess game now. Perhaps I just assumed the SetClearColor() would work with GetImage() but it just grabs nothing? Still doesn't explain why the thumbnail was red though.
EDIT 3: OH jeez, I think figured out why it wasn't working the first time.
I had the update() and Render() commands swapped, so it grabbed the red part of the screen but then quickly changed to nothing and that must be why it saved the image with nothing but the alpha channel and still gave it a red thumbnail. But the drawbox idea works out a lot better I think. Don't know why I didn't think of that at first to begin with honestly...
This is what it looks like now, and it works beautifully.
// Project: Breakout
// Created: 2014-12-19
// set window properties
SetWindowTitle( "Breakout" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
// Draw a blue sprite to color later
Swap()
DrawBox ( 0, 0, 32, 16, MakeColor(0, 0, 255), MakeColor(0, 0, 255), MakeColor(0, 0, 255), MakeColor(0, 0, 255), 1)
Update(0)
Render()
blue = GetImage ( 0, 0, 32, 16 )
DrawBox ( 0, 0, 32, 16, MakeColor(255, 0, 0), MakeColor(255, 0, 0), MakeColor(255, 0, 0), MakeColor(255, 0, 0), 1)
Update(0)
Render()
red = GetImage ( 0, 0, 32, 16 )
SaveImage ( blue, "blue.png" )
SaveImage ( red, "red.png" )
blueBlock = CreateSprite ( LoadImage ( "blue.png" ) )
redBlock = CreateSprite ( LoadImage ( "red.png" ) )
SetSpritePosition ( blueBlock, 32, 32 )
SetSpritePosition ( redBlock, 66, 32 )
do
Print( Round(ScreenFPS()) )
Sync()
loop
7+ years and counting!