image featur request
Blitz3D Forums/Blitz3D Programming/image featur request
| ||
I like the ability to adjust entityalpha. It has come on handy a time or two. My feature request is some form of imagealpha command. I use a PNG for my aimpoint in my fps. Being able to change the alpha depending on if I was on a target or not would be cool. Maybe there is a simple way to do this but I don't know it. Anyone got any ideas? -Rook |
| ||
I'd suggest not making 2d images with 3d graphics. It will slow your game down on some/alot of machines. Some graphics cards don't like mixing 2d and 3d. Best off using a sprite, then you get all the benefits of alpha, rotation and scaling :) |
| ||
so I can use a sprite as an aimpoint? I hadn't thought of that... -RZ |
| ||
Parent it to the camera and use EntityOrder to make sure it is always drawn in front. That way you can use the alpha channel (or a mask) in your image. |
| ||
so I can use a sprite as an aimpoint? of course |
| ||
EntityOrder... another new command to learn! : ) The knowledge never stops but it is so much fun! -Z |
| ||
Here's some basic code you could use as an example (I haven't tested it, so bear with me here).;; Basic Setup C = CreateCamera() S = CreateSprite() T = CreateTexture(16,16) ;; Create cross-hair texture SetBuffer(TextureBuffer(T)) Color 0,0,0 Rect 0,0,16,16,True Color 255,255,255 Rect 0,0,16,16,False Line 8,0,8,16 Line 0,8,16,8 SetBuffer(BackBuffer()) ;; Set up cross-hair sprite EntityTexture S,T,0,0 EntityOrder S,-100 EntityBlend S,3 EntityParent S,C,0 PositionEntity S,0,0,100 |
| ||
you may need to use Pixies ( donno the link tho ) |
| ||
So I couldn't use a PNG or JPG as a sprite... -RZ |
| ||
Sure. Just replace CreateSprite with LoadSprite and load your image. |