
-----------------------------------
musicman
Thu Jun 03, 2010 9:59 am

flickerless menu
-----------------------------------
this is a menu for a collection of games i am making, but i would like to have this menu without the flickering. i have tried to use the ("offscreenonly") syntax because that is whats i was told would work. is there any other way to do this?



    drawfillbox (50, 50, 100, 100, 7)
    var x, y : int
    var a : string (1)
    x := maxx div 2
    y := maxy div 2
    var chars : array char of boolean
    loop
    colorback (7)
        drawbox (0, 0, maxx, maxy, 10)
        drawbox (0,0,195,195,10)
        drawbox (0,maxy, 195, maxy - 195, 10)
        drawbox (maxx, 0, maxx-195, 195, 10)
        drawbox (maxx, maxy, maxx - 195, maxy - 195, 10)
        drawbox (200, 0, maxx - 200, 100, 10)
        drawbox (200, maxy - 100, maxx - 200, maxy, 10)
        Input.KeyDown (chars)
        if x > 5 and x < 635 and y > 5 and y < 395 then
            if chars (KEY_UP_ARROW) then
                y := y + 5
            end if
            if chars (KEY_RIGHT_ARROW) then
                x := x + 5
            end if
            if chars (KEY_LEFT_ARROW) then
                x := x - 5
            end if
            if chars (KEY_DOWN_ARROW) then
                y := y - 5
            end if
           
        elsif x < 6 or x > 636 or y < 6 or y > 396 then
            x := maxx div 2
            y := maxy div 2
        end if
        drawoval (x, y, 4, 4, 10)
        delay (10)
        cls
        color (10)
        put x, " " ..
        put y

    end loop



-----------------------------------
SNIPERDUDE
Thu Jun 03, 2010 10:13 am

Re: flickerless menu
-----------------------------------
I've made a couple updates and pointed them out.  Call them mini-lessons.
setscreen ("graphics:639;399,nobuttonbar,offscreenonly")
% ^ Setting it to graphics, screen size 639x399, hiding the button bar at the top of the run window, and the needed offscreenonly for drawing.

drawfillbox (50, 50, 100, 100, 7)
colorback (7)    % 636 or y < 6 or y > 396 then
        x := maxx div 2
        y := maxy div 2
    end if
    drawoval (x, y, 4, 4, 10)
    delay (10)
    put x, " " ..
    put y
    View.Update   %