Oppure

Loading
Questo topic e' stato chiuso dal moderatore.
04/02/11 21:20
skynet1994
Ciao a tutti ho un problema con un Mouse.. Ho questo codice:
 public static void Start()
        {
            VGAScreen.Clear(3); //Sfondo Celeste
            uint Colore = 0;
            VGAScreen.SetPixel320x200x8(5, 5, Colore);
            
            
            
            uint x = (uint)Mouse.X; 
            uint y = (uint)Mouse.Y; 
            uint oc = 0; 
            while (true) 
            { 
                uint mx = (uint)Mouse.X; 
                uint my = (uint)Mouse.Y;

                
                if (mx != x || my != y)
                {
                                       
                    
                    if (Mouse.Buttons == Mouse.MouseState.Left)
                    {
                        VGAScreen.SetPixel320x200x8(x, y, 4); 
                    }
                    else if (Mouse.Buttons == Mouse.MouseState.Right)
                        VGAScreen.SetPixel320x200x8(x, y, 6);

                    

                    else
                        VGAScreen.SetPixel320x200x8(x, y, oc); 
                    x = mx; y = my;
                    oc = VGAScreen.GetPixel320x200x8(x, y);
                    VGAScreen.SetPixel320x200x8(x, y, 5); 
                }
            } 
        
        

               

        }


Io vorrei fare in modo che quando il Mouse passa sopra il Pixel 5,5 voglio che succeda una cosa che inseriro io.. comunque con questo codice il mouse se premuto il tasto destro disegna sullo schermo. Il invece devo riuscire a far in modo che quando il mouse preme il tasto destro sul pixel 5,5 succeda una determinata cosa che al momento non interessa.. Grazie in Anticipo ;)
aaa
05/02/11 16:01
Il Totem
if (mx == 5 && my = 5) non va bene?
aaa