|
i want to build a function for a debuger i am working on,for this i want to make a grid 24*32 on the screen and show me in which square the mouse is at every point of time i want to color red the square. in order to do it i created a plane with a material red.png i set the alpha to 0. next i want that when my mouse is on the square to set the alpha of the square to 1 and restore to 0 if i leave the square. my questions a) is there a better way to do it? b) what i did ,didnt work can anyone help me figuring out why? thanks in advance and sorry for the poor english
(comments are locked)
|
|
You don't appear to be setting the pixels back again after your paint function. GetPixels gives you an array that you can play with but you need to use SetPixels32 to set it back and then do a And it would probably be easier to make a texture that was the size of a block and just draw it in the right location when you need it. Especially if this is a 2D grid overlaid on the screen.
Jun 14 '12 at 02:24 PM
whydoidoit
ok i understand you guys but what about the performance ? if i use it with system that supports two or more mouses isn't drawing more stuff will slow the system?
Jun 17 '12 at 08:03 AM
blackpag
You would be better off doing what I said in my first comment to this answer for performance, but it will probably be ok. Looks like you are thinking is manipulating pixels which isn't going to be the fastest thing you could do with a system that is designed to paint areas of the screen quickly.
Jun 17 '12 at 09:18 PM
whydoidoit
how do i do i draw the texture on location?
Jun 18 '12 at 11:20 AM
blackpag
Well you can use GUI.DrawTexure or perhaps event GUI.SelectionGrid
Jun 18 '12 at 11:23 AM
whydoidoit
(comments are locked)
|

it is bizarre to approach the problem this way, man.
you could do it 10 thousand times more easily and more reliably simply by moving objects around, or something like that !
To all people who want to hear the conclusion. setpixel made my debuger work at 15 fps. setpixels improved it to 60. GUI.DrawTexture improved it to 150