Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 24th Apr 2003 21:28
I`m having trouble texturing a single tile on a matrix

I want to texture at the co-ordinate I click wit the mouse ( I have sorted that code out! )
just the texturing,

could somebody post a snippet?????

TIA
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 24th Apr 2003 22:13
I have got this so far


where EX & EY are co-ordinated of the matrix, sel(X,X) is an array to hold selected co-ordinates, but as soon as I run my code, the complete matrix is textured...
how do I prepare a texture, but not use it, until I want to texture a tile ?

Magefire
23
Years of Service
User Offline
Joined: 20th Feb 2003
Location:
Posted: 24th Apr 2003 23:02
I once tried that and it doesn't work. I don't believe you can simply prepare textures without texturing. Try typing this instead of prepare matrix texture 1, 1, 1, 1

This will make it so that the texture is broken into four parts. You can then texture a tile or tiles of the matrix using one of the four sections of the texture. I expect that they would be broken into equal sections. You might be able to place information for certain tiles into one section of the image you want to texture. This will allow you to texture the rest of the matrix with the normal image and the tiles you want with the correct image. The only problem is that you might need to texture the entire matrix by hand otherwise the picture you don't want in there might appear. Another problem is that I don't know what section numbers coorispond with which sections.

I hope this helps.

If you give a man some fire, he will be warm for a day. If you set a man on fire, he will be warm for the rest of his life.
Firesea
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 25th Apr 2003 03:54
This is the point I made earlier. Preparing a texture texturizes the matrix with tile 1. Try it... split a texture into 4 parts, then look at the matrix, tile one has filled all the squares.

I am also wondering if the inital texture is not replaced when you do texturize the matrix but is actually still underneath. It sure looked like that on some of my "white" grids.

Bug or is this the only way it can work.

Got no response on this earlier either.
Stevo
23
Years of Service
User Offline
Joined: 4th Oct 2002
Location:
Posted: 25th Apr 2003 16:05
this took me so so long to work out (dB help!!) you have to look at it caerfully, if you do a 20,20 matrix that will give you 20*20=400 available tiles. When you prepare matrix tile you are saying how many textures you are going to have, prepare matrix texture 1,1,2,2 =4 textures. (sorry if i get this a bit wrong, because i'm not at home right now so i haven't got the code in front of me), the next thing is set matrix tile you have matrix number then the x & y, then the tile number. you can use a for to loop
for x= 0 to 19
for z= 0 to 19
t=1
set matrix tile 1,x,z,t
inc t
rem set t back to 1
if t= 5
t = 1
next x
next y

if you just left t as 1 then all your matrix would be set to texture 1

if you do prepare matrix texture 8,8, that would give you 64 textures
The next thing is to find a way to mannually change the things
you can use arrorw keys ect,
if leftkey()=1
x=x+1
etc etc, once you do that you have another one for the texture
if shiftkey()=1
t=t +1
etc

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 26th Apr 2003 01:39
ok, I got the matirx to texture the tile I require, as I wanted!
I`m now trying to write the code to do the following....

I click a co-ordinate & hold the mouse button down & drag either left/right or up/down ( I wont need angled selection - unless its easy to code! )

I want the tiles to be textured, from the start point, to the current point of the mouse

ever played age of empires ?, when you click & drag to build a wall ?

well, that kinda thing!

I dont think it will be easy, but any suggestions will help

Login to post a reply

Server time is: 2026-07-11 09:30:07
Your offset time is: 2026-07-11 09:30:07