Another question about graphics
Blitz3D Forums/Blitz3D Beginners Area/Another question about graphics
| ||
Hi, is there a built in way to do the following. I'd like to have a pattern, say 128 by 128 pixels. I'd then like to use 64 by 64 pixel 'shapes'. These shapes are either black or pattern. I'd like to be able to change the pattern every frame without having many sets of 'shapes' duplicated. I hope this makes sense to someone. I'm just trying to get a set of blocks with a changing pattern 'in' them without duplicating the set of blocks for each pattern. I don't think it is possible but I thought I would ask. Thanks Marg |
| ||
hmmm... dunno what to make about this one :) sounds like TileImage or TileBlock to me.. |
| ||
draw the block then the patern anim on top? or use pixel commands? |
| ||
your post didn't exactly make it out right. Theres a createimage function, that can create an image that is layered upon a virtually unlimited amount of images. so try: Graphics 800,600,16,1 ;this next line creates a128pixel by 128pixel image with 32 subframes so to say 2 is for 2 frames image=Createimage(128,128,2) ;then create a filled box at 0,0 128 by 128 colorwhite color 255,255,255rect 0,0,128,128,1 ;then load/grab the image and save it as image,frame0 ;note the fram starts as 0, like an array grabimage image,0,0,0 ;then change the color of the box, its grey now color 128,128,128:rect 0,0,128,128 ;grab the second frame, frame 1 grabimage image,0,0,1 ;okay now clear the screen and flip em clscolor 64,0,0 cls ;Run a loop and switch the images from white to grey,x is ;the pointer x=0 while not keyhit(1) x=x+1 drawimage image,100,100,x If x=1 then x=0 delay 300 wend end There is a way to flip rotate the image if that is what your looking for. I'm not sure how to do it in blitz2d, but its really easy to do in blitz 3d. In b3d you create a flat mesh, only needs to be 4vertexes and 2 triangles so its sqaure, and then just change the texture coordinates of the vertexes and that gives you 90 deg of rotation each way, but you can just roate the mesh too. Otherwise your gonna have to do it in paint or something. |
| ||
Try rephrasing your question or post an image (worth a thousand words). |
| ||
What I'm trying to do is create a 'Thrust' style looking game. Except I want the walls etc to be made with animated patterns. I want the blocks to be separate from the patterns so that I don't need loads of the same shaped blocks with different patterns on them. Hope this is clearer. Marg |
| ||
I've never seen this thrust game and all searches for it come up with some kind of rocket ship game. Is this it? If it is, then I'm not sure what you are attempting. From what I can gather from your post, it sounds like you want something animated in the background. If you use transparent blocks (using DrawImage), the animated image would show through. |
| ||
I understand now (I think)! He's asking if you can flood-fill a solid, irregular-shaped block of colour with a pattern! (right?) As far as I know, you can't. |
| ||
![]() is it this THRUST you talk about? thrust site from Blitzcoder? |
| ||
Use TileImage on the backbuffer to coat the entire buffer with the tile you want. Then DrawImage your level on top of the tiled images, making sure that your tunnels and whatnot are =not= the transparent color, and that your walls and what's inside them =are= the transparent color, when drawing your level. They'll lay nicely over the tiled image and it'll look as though you're floodfilling the image when in fact you're just stamping the tunnels over em. |
| ||
Thanks everyone, I've a better idea how to do it now. Marg |