How can I create a glowing line effect?
BlitzMax Forums/BlitzMax Programming/How can I create a glowing line effect?
| ||
I'd like to create a retro-looking 2D game and I really like the "glowing line" effect that a game called Project Vex does. Other examples of games that do this are GridWars and Defcon. I've tried looking at the source to GridWars but the code is so large that I can't find out what I need to do this myself... (eg. all I want to do is draw a polygon that glows) Here are screenshots of the effect I'm trying to achieve: http://devimg.net/?Post=448 http://www.introversion.co.uk/defcon/about/screenshots.html (the first screenshot [eg. Project Vex] is *exactly* what I'd like) So... how can I do this myself? How can I draw a simple polygon (or line) that is glowing? (I don't care even if I have to use strict OpenGL to do this....) Thanks, John |
| ||
You could do some digging and use Indiepath's Textured Polys mod for this: http://www.blitzbasic.com/Community/posts.php?topic=51059 |
| ||
How would that create glowing lines? I thought that was just for creating textured polygons... (eg. the inside of the polygon) |
| ||
From an old post : HERE Indiepath.TexturedPoly - Now independent of the Official Mods and MacOS compat, contains the New DrawGlowingLines command. |
| ||
Thanks! However, it looks like DrawGlowingLines command was removed from the TexturedPoly package? I downloaded it straight from modules.indiepath.com so I'm not sure what is going on... |
| ||
This is getting somewhat close: Graphics 600,600 SetBlend LIGHTBLEND While Not KeyHit(KEY_ESCAPE) Cls 'need to play with different colors SetColor(0,255,0) DrawGlowLine(0,0,600,600) DrawGlowLine(0,600,600,0) Flip End While Function drawGlowLine(x1:Int,y1:Int,x2:Int,y2:Int) SetAlpha (0.2) SetLineWidth(5) DrawLine(x1,y1,x2,y2) SetAlpha(0.07) SetLineWidth(15) DrawLine(x1,y1,x2,y2) End Function |
| ||
Slight variation, pretty obvious, but it makes the lines flicker. |
| ||
Well, I don't know if this helps but http://bugdie.org/_tmp/texturedpoly.zip Note: use TPoly.Line() to draw it, that's the actual glowing line. |
| ||
lol |
| ||
Thanks for all of the help everybody! It looks like I'll use IndiePath's TexturedPoly add-on... it's easy enough to use (espicially with the examples). Thanks for all of the help :) |
| ||
I have a great idea regarding this that I've actually used before, and it involves using images instead. Let's say you want a line 5 pixels thick and "glowy." So, you draw the line in photoshop as if it were only one pixel long. Meaning you create a .PNG only 1 x 5 pixels, with your most opaque pixel in the middle, and increasing transparency outward. When you want to draw the line, you load the image, then set the handle to the middle pixel. Then you merely set the y-scale and rotation suitably, to create, in effect, a blended line from point A to point B. |
| ||
Yokos got the examples in the zip file he posted. @Tylerbot, kinda but not quite - how do you make the lines have a nice smooth round glow at the ends? Use my module it'll handle everything for you. Here's an example of it being used : ![]() |
| ||
hey that game reminds me of oids. Has it been released at all, demo or otherwise? |
| ||
There is a commercially available version of OIDs for the Mac, but none for pc at the moment. That game above is Thrust Extreme by Wiebo de Wit and is freely available (and it's good. Very good) :) Read all about it and grab it from here - http://wiebo.wordpress.com/my-pc-games/ |
| ||
I'll have to use the glowing routines for my game - looks rather good. Unfortunately it does seem to react badly to other draw objects after it, so maybe I wont be be able to use it. |
| ||
Unfortunately it does seem to react badly to other draw objects after it, so maybe I wont be be able to use it. What does that mean? All it's drawing is 6 triangles per line and texturing them. |
| ||
Without my other stuff, it draw properly. However, put all my other stuff back in (pasting images, drawing other rectangles etc etc), the bottom part of the line bulges out for some reason, and it loses the glowing effect. |
| ||
Indiepath: Here's an example of it being used: Wow, that looks really slick and suitably retro. I'll take a look at your module now :) |