I've been beating my head against the wall for the last several hours based on the same "black texture" problem the previous few posters are having. I've tried setting the global.surface variable that holds the screen at my current view position, and I've tried freeing and remaking the surface every step (in hopes that surfaces are set to the origin of your current view. Tiling the surface doesn't appear to work, and manually setting the surface size to 2048 by 2048 also yields no results (seems to make no difference than the default room_width and room_height arguments). I've tried screen_refresh() as opposed to the script's screen_redraw(). I've also tried getting a sprite of the screen and then drawing that to the surface (I was running out of ideas). In short, my script-fu is not strong enough.
So...anyone know how to make these scripts work outside of my default 1024x768 view (room size is 2048x2048)? Is it possible to set surfaces to have an x and y they follow (I assume this is the problem?)
*Edit: Concise description of problem:
The wave effects are created using textured primitives. The primitives get their texture from the global.srf surface, which takes a screenshot of the room every step. The problem is that the surface doesn't appear to extend past my view of 1024x768, and the room is much larger than the view. When the primitives are drawn outside of the surface (and thus, the texture), they are merely filled with a half-transparent black color, as opposed to the texture they are supposed to possess. I believe this is a problem of either the screen_redraw() function only drawing the first 1024x768 pixels of the room onto the surface or more likely, the surface is not drawn over the entire room, and I cannot find a way to move the surface with the view.
Edit2: In case my description of the problem is incorrect, I'll try to detail how the wave script functions.
1. Surface called global.srf is created. It is supposed to have the same dimensions of the room, but appears to have set dimensions at the first 1024x768 pixels of the room.
2. Screen_redraw() is called while target is set to global.srf to get a screenshot of the room.
3. In its drawing step, obj_wave invokes "draw_wave_off(x,y,global.srf,radius-10,200,-(-radius+200)/5,20,0,0)"
4. The draw_wave_off script creates a texture based off of the global.srf surface.
5. The draw_wave_off script creates a primitive textured ring at the passed arguments x,y on the texture
-> The ring is as wide as your specified width and the script tiles that ring outwards to reach the desired radius of your ripple's circle. The ring is also offset by argument5 to create the ripple effect.
6. The script draws the textures primitives on the default drawing plane in GM.
(I'm not 100% sure on how the vertices are created for the textured primitives in #5.)
Edited by Ezion, 22 December 2008 - 11:57 PM.