I agree that the documentation is lacking (simple examples showcasing usage would be great), but the name is fairly intuitive. These are the two ways you can call the function:
CreateImageColor( imageID, red, green, blue, alpha )
integer CreateImageColor( red, green, blue, alpha )
The
imageID referenced in the first variant and the
integer returned by the function in the second variant are the number you would use when referencing the image in various function calls (to create a sprite from it, draw it, etc.).
What you may be looking for are the drawing commands. These are a bit limited it seems and
dot(x, y) doesn't seem to exist at the moment. However, you could utilize the
DrawLine() function. If you look in the documentation it is located under the
Commands -> Core section.
The function looks like the following:
DrawLine( x, y, x2, y2, color1, color2 )
To draw a single pixel, I had to call it like so:
DrawLine(x, y, x + 1, y + 1, color, color )
This would imply that I'm trying to draw 2 pixels (x, y) and (x+1, y+1), but that doesn't seem to be the case. In my experiments yesterday it seemed that the function wouldn't draw anything unless I added at least one to either x or y. I also noticed some black lines at the edges of my generated textures unless I chose to add one to
both x and y. Since I want only one color I pass that as both color arguments and I have a single dot.
If you want to clear the screen to a solid color you would probably want the
SetClearColor() function along with
EnableClearColor(). The functions look like the following:
SetClearColor( red, green, blue )
EnableClearColor( clear )
and you would call them like so:
// How about clearing the screen to a medium blue color?
SetClearColor(0, 0, 128)
// 1 means enable, 0 means disable
EnableClearColor(1)
However, if you're trying to fill in a render image instead you would need to first create the image with
CreateRenderImage() and then use the
DrawBox() command to draw it in the color(s) that you want. Here's an example of that:
// For the sake of this example assume the following have been set to the values we want/need:
// width
// height
// color
// The third argument of 0 means this is an RGBA image, 1 would be a depth image
// The fourth argument means we don't want mipmapping turned on for this image
myImage = CreateRenderImage(width, height, 0, 0)
// Tell AGK that we want any upcoming drawing calls to draw to our image
// The second argument has to do with depth, which we don't want at the moment
SetRenderToImage(myImage, 0)
// Now draw a box with the upper left corner at (0, 0) and the lower right corner at (width, height)
// Since we only want one color we specify our color argument as the same for all 4 corners
// The last argument is set to one to indicate that we want the box filled
DrawBox(0, 0, width, height, color, color, color, color, 1)
// Now tell AGK that we want further drawing calls to be made to the screen
SetRenderToScreen()
Hopefully I answered this in a way that helps. If you need clarification of anything let me know. I just got AppGameKit yesterday, but spent a lot of time with DB Classic and DBPro a few years ago so learning this is going pretty quickly.
[Edit] Just as a heads up I've noticed some odd behavior with this when trying to animate textures. I'm probably missing something, but
SetRenderToScreen() seems to not properly switch back to the screen until the second
Sync() call.