Tibialyzer.OutfiterManager.ColorIndex C# (CSharp) Метод

ColorIndex() публичный статический Метод

public static ColorIndex ( int x, int y ) : int
x int
y int
Результат int
        public static int ColorIndex(int x, int y)
        {
            int index = (x / OutfitColorBoxSize) + OutfitColorsPerRow * (y / OutfitColorBoxSize);
            if (index < 0 || index >= outfitColors.Count) return -1;
            return index;
        }

Usage Example

Пример #1
0
        private void ChangeOutfitColor(object sender, MouseEventArgs e)
        {
            int index = OutfiterManager.ColorIndex(e.X, e.Y);

            if (index < 0)
            {
                return;
            }
            outfit.colors[colorIndex] = index;
            RefreshColorPicker(colorIndex);
            RefreshImage();
        }