image featur request

Blitz3D Forums/Blitz3D Programming/image featur request

Rook Zimbabwe(Posted 2004) [#1]
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


Ross C(Posted 2004) [#2]
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 :)


Rook Zimbabwe(Posted 2004) [#3]
so I can use a sprite as an aimpoint? I hadn't thought of that...
-RZ


Rottbott(Posted 2004) [#4]
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.


WolRon(Posted 2004) [#5]
so I can use a sprite as an aimpoint?
of course


Rook Zimbabwe(Posted 2004) [#6]
EntityOrder... another new command to learn! : )

The knowledge never stops but it is so much fun!

-Z


N(Posted 2004) [#7]
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



Neochrome(Posted 2004) [#8]
you may need to use Pixies ( donno the link tho )


Rook Zimbabwe(Posted 2004) [#9]
So I couldn't use a PNG or JPG as a sprite...
-RZ


jhocking(Posted 2004) [#10]
Sure. Just replace CreateSprite with LoadSprite and load your image.