Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to change the background while running

edited June 2014 in General Posts: 24

Put this code in a new project don't spam my email for references only

-- Made By Daniel Kane
-- daniel.kane@y7mail.com
-- DONT COPY




-- Background

-- Use this function to perform your initial setup
function setup()
    print("For Black do all 0")
    print("For White do all 255")
    parameter.integer("Red",0,255,0)
    parameter.integer("Green",0,255,0)
    parameter.integer("Blue",0,255,0)
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(Red,Green,Blue)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here

end
Tagged:

Comments

  • Posts: 1,595

    Put this in setup()

    colorbg = color(40,40,50)
    parameter.color("colorbg",colorbg)
    

    Put this in draw()

    background(colorbg)
    

    You could also add a callback to the parameter.color to change the background but that requires backingMode(RETAINED)

  • dave1707dave1707 Mod
    Posts: 7,683

    Try this. Just tilt in different directions.


    supportedOrientations(PORTRAIT) displayMode(FULLSCREEN) function draw() background(math.abs(Gravity.x*256),math.abs(Gravity.y*256),math.abs(Gravity.z*256)) end
  • Posts: 1,976

    @Luatee @dave1707 I believe he was sharing his code, not asking for help...

  • dave1707dave1707 Mod
    Posts: 7,683

    @SkyTheCoder I was sharing my code, not offering help.

  • Posts: 1,595

    @SkyTheCoder My bad, I see! Well I hope the colour picker parameter command helps if you did not see it already @Dantheman2001

Sign In or Register to comment.