Ejemplo n.º 1
0
    void Start()
    {
        colorPicker = UIColorPicker.create("ColorPalette.png", 0, 0, 1);
        colorPicker.positionFromTopLeft(0.3f, 0.2f);
        colorPicker.highlightedTouchOffsets = new UIEdgeOffsets(40);
        colorPicker.onColorChange          += onColorChange;
        colorPicker.onColorChangeBegan     += onColorChangeBegan;

        chosenColor = UIButton.create("ColorButtonUp.png", "ColorButtonDown.png", 0, 0);
        chosenColor.pixelsFromTopRight(50, 50);
        chosenColor.color = Color.white;

        recentColors = new UIButton[numRecent];
        for (var i = 0; i < numRecent; i++)
        {
            recentColors[i] = UIButton.create("ColorButtonUp.png", "ColorButtonDown.png", 0, 0);
            recentColors[i].pixelsFromBottomLeft(50, 50 + (int)(i * recentColors[i].width));
            recentColors[i].onTouchUpInside += recentColorButtonTouchUp;
        }
    }
Ejemplo n.º 2
0
 public static UIColorPicker create(string filename, int xPos, int yPos, int depth)
 {
     return(UIColorPicker.create(UI.firstToolkit, filename, xPos, yPos, depth));
 }