Ejemplo n.º 1
0
    public void setBackground(ColourConfiguration colourConfig)
    {
        this.colourConfig = colourConfig;

        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Dawn) {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags = CameraClearFlags.Skybox;
            RenderSettings.skybox = dawnMaterial;
        }
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Eerie) {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags = CameraClearFlags.Skybox;
            RenderSettings.skybox = eerieMaterial;
        }
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Night) {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags = CameraClearFlags.Skybox;
            RenderSettings.skybox = nightMaterial;
        }
        /*
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Julia) {
            //julia set takes time to render so kick it off in thread
            //and wait until its generated before switching cameras
            //carry on doing whatever we are doing now until render ready
            BackgroundImageControllerScript.startJuliaSet();
            waitForJuliaSetToRender = true;
        }
        //*/
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.None) {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags = CameraClearFlags.Skybox;
            RenderSettings.skybox = noMaterial;
        }
    }
Ejemplo n.º 2
0
    public void setBackground(ColourConfiguration colourConfig)
    {
        this.colourConfig = colourConfig;

        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Dawn)
        {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags    = CameraClearFlags.Skybox;
            RenderSettings.skybox    = dawnMaterial;
        }
        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Eerie)
        {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags    = CameraClearFlags.Skybox;
            RenderSettings.skybox    = eerieMaterial;
        }
        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Night)
        {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags    = CameraClearFlags.Skybox;
            RenderSettings.skybox    = nightMaterial;
        }

/*
 *              if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Julia) {
 *                      //julia set takes time to render so kick it off in thread
 *                      //and wait until its generated before switching cameras
 *                      //carry on doing whatever we are doing now until render ready
 *                      BackgroundImageControllerScript.startJuliaSet();
 *                      waitForJuliaSetToRender = true;
 *              }
 * //*/
        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.None)
        {
            backgroundCamera.enabled = false;
            mainCamera.clearFlags    = CameraClearFlags.Skybox;
            RenderSettings.skybox    = noMaterial;
        }
    }
Ejemplo n.º 3
0
 public ColourConfiguration(ColourConfiguration config)
 {
     this.cycleColour = config.getCycleColour();
     //this.currentColour
     this.cycle      = config.getCycle();
     this.pulseCount = config.getPulseCount();
     //this.pulseLength
     this.pulse      = config.getPulse();
     this.pulseSpeed = config.getPulseSpeed();
     //this.pulseSpeedCount
     this.fadeColour     = config.getFadeColour();
     this.baseRed        = config.getBaseRed();
     this.baseGreen      = config.getBaseGreen();
     this.baseBlue       = config.getBaseBlue();
     this.backgroundType = config.getBackgroundType();
 }
Ejemplo n.º 4
0
 public void createNewBrush()
 {
     //clear current brush
     clearBrush();
     //create new colour configuration for each form
     ColourConfiguration.BackgroundType background = ColourConfiguration.BackgroundType.None;
     if (colourConfig != null)
     {
         background = colourConfig.getBackgroundType();
     }
     colourConfig = new ColourConfiguration();
     colourConfig.setBackgroundType(background);
     //create new brush
     brush = new Trunk(currentConfig, colourConfig);
     largestBoundsDistance = brush.getLargestBoundDistance();
 }
Ejemplo n.º 5
0
 public ColourConfiguration(ColourConfiguration config)
 {
     this.cycleColour = config.getCycleColour ();
     //this.currentColour
     this.cycle = config.getCycle ();
     this.pulseCount = config.getPulseCount ();
     //this.pulseLength
     this.pulse = config.getPulse ();
     this.pulseSpeed = config.getPulseSpeed ();
     //this.pulseSpeedCount
     this.fadeColour = config.getFadeColour ();
     this.baseRed = config.getBaseRed ();
     this.baseGreen = config.getBaseGreen ();
     this.baseBlue = config.getBaseBlue ();
     this.backgroundType = config.getBackgroundType ();
 }
Ejemplo n.º 6
0
    public void displayColourPalette(ColourConfiguration colourConfig)
    {
        Color guiColour = GUI.color;

        // Make a background box
        GUI.Box(new Rect(Screen.width - 210, 10, 200, 450), "Colour Palette");

        // pulsate colour button
        if (colourConfig.getPulse()) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 40, 180, 20), "Pulsate Colour")) {
            colourConfig.setPulse(!colourConfig.getPulse());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        //pulsate speed slider
        GUI.Label (new Rect (Screen.width - 146, 70, 180, 20), "Pulse Speed");

        colourConfig.setPulseSpeed (GUI.HorizontalSlider (new Rect (Screen.width - 200, 100, 180, 20), colourConfig.getPulseSpeed(), 10.0f, 0.0f));

        // colour cycle button
        if (colourConfig.getCycle()) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 130, 180, 20), "Cycle Colour")) {
            colourConfig.setCycle(!colourConfig.getCycle());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        // Base colour button
        if (colourConfig.getFadeColour()) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 160, 180, 20), "Fade Colour")) {
            colourConfig.setFadeColour(!colourConfig.getFadeColour());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        //rgb colour sliders
        GUI.Label (new Rect (Screen.width - 160, 190, 180, 20), "Red, Green, Blue");

        colourConfig.setBaseRed(GUI.HorizontalSlider (new Rect (Screen.width - 200, 220, 180, 20), colourConfig.getBaseRed(), 0.0f, 1.0f));

        colourConfig.setBaseGreen(GUI.HorizontalSlider (new Rect (Screen.width - 200, 250, 180, 20), colourConfig.getBaseGreen(), 0.0f, 1.0f));

        colourConfig.setBaseBlue(GUI.HorizontalSlider (new Rect (Screen.width - 200, 280, 180, 20), colourConfig.getBaseBlue(), 0.0f, 1.0f));

        for (int i = 0; i < 200; i++) {
            for (int j = 0; j < 20; j++) {
                Color currentColor = new Color (colourConfig.getBaseRed(), colourConfig.getBaseGreen(), colourConfig.getBaseBlue(), 1.0f);
                texture.SetPixel (i, j, currentColor);
            }
        }
        texture.Apply();
        GUI.Box(new Rect(Screen.width - 200, 310, 180, 20), texture);

        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Dawn) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 340, 180, 20), "Dawn Skybox")) {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Dawn);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Eerie) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 370, 180, 20), "Eerie Skybox")) {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Eerie);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Night) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 400, 180, 20), "Night Skybox")) {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Night);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

        /*
        //NOT IN USE
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Julia) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 430, 180, 20), "Julia")) {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Julia);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;
        //*/
        if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.None) {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 430, 180, 20), "None")) {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.None);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;
    }
Ejemplo n.º 7
0
    public void displayColourPalette(ColourConfiguration colourConfig)
    {
        Color guiColour = GUI.color;

        // Make a background box
        GUI.Box(new Rect(Screen.width - 210, 10, 200, 450), "Colour Palette");

        // pulsate colour button
        if (colourConfig.getPulse())
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 40, 180, 20), "Pulsate Colour"))
        {
            colourConfig.setPulse(!colourConfig.getPulse());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        //pulsate speed slider
        GUI.Label(new Rect(Screen.width - 146, 70, 180, 20), "Pulse Speed");

        colourConfig.setPulseSpeed(GUI.HorizontalSlider(new Rect(Screen.width - 200, 100, 180, 20), colourConfig.getPulseSpeed(), 10.0f, 0.0f));

        // colour cycle button
        if (colourConfig.getCycle())
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 130, 180, 20), "Cycle Colour"))
        {
            colourConfig.setCycle(!colourConfig.getCycle());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        // Base colour button
        if (colourConfig.getFadeColour())
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 160, 180, 20), "Fade Colour"))
        {
            colourConfig.setFadeColour(!colourConfig.getFadeColour());
            callback.updateColourConfig(colourConfig);
        }
        GUI.color = guiColour;

        //rgb colour sliders
        GUI.Label(new Rect(Screen.width - 160, 190, 180, 20), "Red, Green, Blue");

        colourConfig.setBaseRed(GUI.HorizontalSlider(new Rect(Screen.width - 200, 220, 180, 20), colourConfig.getBaseRed(), 0.0f, 1.0f));

        colourConfig.setBaseGreen(GUI.HorizontalSlider(new Rect(Screen.width - 200, 250, 180, 20), colourConfig.getBaseGreen(), 0.0f, 1.0f));

        colourConfig.setBaseBlue(GUI.HorizontalSlider(new Rect(Screen.width - 200, 280, 180, 20), colourConfig.getBaseBlue(), 0.0f, 1.0f));

        for (int i = 0; i < 200; i++)
        {
            for (int j = 0; j < 20; j++)
            {
                Color currentColor = new Color(colourConfig.getBaseRed(), colourConfig.getBaseGreen(), colourConfig.getBaseBlue(), 1.0f);
                texture.SetPixel(i, j, currentColor);
            }
        }
        texture.Apply();
        GUI.Box(new Rect(Screen.width - 200, 310, 180, 20), texture);

        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Dawn)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 340, 180, 20), "Dawn Skybox"))
        {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Dawn);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Eerie)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 370, 180, 20), "Eerie Skybox"))
        {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Eerie);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.Night)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 400, 180, 20), "Night Skybox"))
        {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Night);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;

/*
 * //NOT IN USE
 *              if (colourConfig.getBackgroundType () == ColourConfiguration.BackgroundType.Julia) {
 *                      GUI.color = Color.green;
 *              }
 *              if (GUI.Button(new Rect(Screen.width - 200, 430, 180, 20), "Julia")) {
 *                      colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.Julia);
 *                      callback.setBackground(colourConfig);
 *              }
 *              GUI.color = guiColour;
 * //*/
        if (colourConfig.getBackgroundType() == ColourConfiguration.BackgroundType.None)
        {
            GUI.color = Color.green;
        }
        if (GUI.Button(new Rect(Screen.width - 200, 430, 180, 20), "None"))
        {
            colourConfig.setBackgroundType(ColourConfiguration.BackgroundType.None);
            callback.setBackground(colourConfig);
        }
        GUI.color = guiColour;
    }