|
Post by u9 on Feb 15, 2007 13:39:39 GMT -5
I don't think the graphics.createImage command clears the memory the image uses. I'm not exactly sure what is wrong, but after creating an image the content seems to remain on the surface between runs. I.e. I create an image and just display it, then the content of it is what was on it when I exited the program previously.
Also, the code-completion in the editor suggests a parameter [colorkey] as optional yet this one is not documented in the manual. Could you please also rectify this.
|
|
|
Post by Guilect on Feb 15, 2007 18:04:43 GMT -5
I don't doubt that you see what you say. Have not seen it here. I will keep looking.
The code for the 'createimage' subroutine calls a clear routine, so everytime you create it should be cleared.
Good catch. The manual is correct. You can not specify a colorkey. It has been removed from the code-completion.
|
|
|
Post by u9 on Feb 16, 2007 13:10:47 GMT -5
I'll do some tests and see if i can create you an exact procedure to reproduce the effect.
|
|
|
Post by u9 on Feb 17, 2007 20:29:24 GMT -5
Ok here's the procedure: 1. Download my normally distributed first person shooting demo thingy. 2. Run the code from the editor... and shoot away at the poor screen for a while. (FYI: left button is the one i like ) After shooting for a while, press escape to exit the program and return to the editor. 3. Go to the procedure (sub) called ClearTarget and comment out the line: Call graphics.clear... 4. Run the code again. If everything is nice and FUBAR as it is on my computer, you should notice that the screen will be shot to pieces as it was when you exited from your previous run... right? I.e. even though you just started running the code again and there is a call somewhere in the start that says: call graphics.createimage, this newly created image is not cleared when created. Please let me know if you do not get the same effect. Of course the newly created image should be cleared (as stated in the manual.)
|
|
|
Post by u9 on Feb 17, 2007 20:48:30 GMT -5
Here's what i think is happening. Because i am not clearing the window before drawing on it i am seeing results from the old run. Now the newly created image (which i am drawing the shots on) is cleared and also has it's alpha value set to 0 so it is basically transparent. So I guess we can put this down to my misunderstanding of alpha channels But maybe it would be a good idea to clear the main window surface also in the graphics.initialize call.
|
|
|
Post by Guilect on Mar 3, 2007 21:14:02 GMT -5
I have added a clear screen to the graphics.initialize.
|
|