Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 loading bar....help plz
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lilsaku




PostPosted: Thu Jun 14, 2007 2:35 am   Post subject: loading bar....help plz

i cant seem to get this loading bar to wok.


View.Set ("offscreenonly")
% The background code.
var pic : int := Pic.FileNew ("back.jpg")
var width : int := Pic.Width (pic)
var height : int := Pic.Height (pic)
var x, y : int := 0
loop
exit when y > maxy
loop
exit when x > maxx
Pic.Draw (pic, x, y, picCopy)
x := x + width
end loop
x := 0
y := y + height
end loop
%this is the code for the start screen
var m, n, button : int

var font1 := Font.New ("Arial:30")
var font2 := Font.New ("Arial:14")
var s : int := 0
var q : string
Font.Draw (" welcome ", 1, 351, font1, white)
Font.Draw (" welcome ", 0, 350, font1, black)

%loading bar
Font.Draw ("loading....", 300, 25, font2,red)
colorback (black)
var row, column : int
loop
randint (row, 23, 24)
randint (column, 1, 80)
locate (row, column)
put " " ..
View.Update
exit
end loop
loop
Mouse.Where (m, n, button)
Text.Locate (1, 1)
drawfillbox (65, 245, 115, 295, white)
drawfillbox (70, 250, 110, 290, black)
Font.Draw (" start!", 65, 258, font2, white)
View.Update
if button = 1 and m >= 70 and m <= 110 and n >= 250 and n <= 290 then
q := intstr (s)
Font.Draw (" here we go!!!", 1, 201, font1, white)
Font.Draw (" here we go!!!", 0, 200, font1, black)
View.Update
delay (1000)
cls
exit
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
Jerrik




PostPosted: Sat Jun 16, 2007 9:55 pm   Post subject: Re: loading bar....help plz

I'm unsure of what you actually wanted it to do, but I rewrote the loading bar to look like one..

code:
var font1 := Font.New ("Arial:30")
var font2 := Font.New ("Arial:14")
var s : int := 0
var q : string
Font.Draw (" welcome ", 1, 351, font1, white)
Font.Draw (" welcome ", 0, 350, font1, black)
var load : string := "Loading"

%loading bar
var row, column : int
loop
    Font.Draw (load, 300, 25, font2, red) %Draws the loading text
    View.Update %Updates the screen
    Time.DelaySinceLast (400) %Waits 400/1000 second
    load += "." %Increases the loading text by one dot
    exit when length (load) > 12 %Exits when the loading bar text is a certain length
end loop


Also, please use code tags when submitting code, it makes it much easier to read, as you can probably tell.

EDIT - These are the kind of problems you might want to solve on your own in the future. They aren't particularly difficult, and it forces you to think about your code and what its actually doing, and why its doing that. Whenever something doesn't work the way its intended, it simply means we have a misunderstanding and can learn from it, or we made a typo and get to go on a bug catching safari.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: