sprite and 2d problems
Blitz3D Forums/Blitz3D Beginners Area/sprite and 2d problems
| ||
want to ask something here. how do i make an intro screen before my program starts? I tried making an image at 800 by 600, then tried loading it as a sprite. Here's the basic code: Graphics3D 800, 600 cam = CreateCamera() PositionEntity cam, 0, 0, -5 splash = LoadSprite("splash_screen.jpg") SpriteViewMode splash, 1 PositionEntity splash, 0, 0, 0 While Not KeyHit(1) Wend End however, i cannot see the sprite anywhere. It just return a black screen. Another funny thing is, i tried creating a cube at the point 0,0,0 and have a camera positioned a bit back from the cube. When i run the program, i can see the cube clearly. But when i remove the cube and place a sprite at the same 0, 0, 0 position, i couldn't see the sprite! thanks! terry |
| ||
Search for Pixies in the code archives by Skidracer. This will display a pixel perfect version of your screen on a sprite. Note that 800x600 is a non-standard texture size so this may be why it's not being displayed. The Pixes code is designed to deal with this though so should be what you're looking for. Stevie. |
| ||
This will work...I'm using this in my projects.. Graphics3D 800,600 camera=CreateCamera() CameraRange camera,0.2,400 ;your sprite tex=LoadTexture("splash.png",2) TextureBlend tex,2 splash=CreateSprite() EntityTexture splash,tex EntityFX splash,1 EntityOrder splash,-1 EntityParent splash,camera MoveEntity splash,0,0,20;set up proper distance from camera While Not KeyHit(1) Renderworld Flip Wend End |
| ||
The reason why that's not working is because you're not rendering the scene. Renderworld Flip |
| ||
Yeah Rob's right - as usual! Updateworld Renderworld flip Tends to work well if you want to see stuff! Also scale up your sprite it may be too small! IPete2. |