QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: sarmad on September 19, 2021, 06:27:03 am
-
hello every one
am just a bigenner in qb64 i try to make a program that print numbers from 1 to 40 and draw a circle .. very simple but when i run that i get the numbers from 13 to 40 with no scrollable screen and get the circle inside .. when i use $console:only with aame program i get no thing as shown in pictures.. how can i combine between 1 to 40 scrollable window and the circle in one o/p window?
-
I am no expert, when it comes to QB64, but from using 'help' > Keyword Index > SCREEN (statement)... Screen 12, depending on the size of font, will either have 30 or 60 lines of text. The default setting seems to be 30 lines. So, in a nutshell, once "i" has passed 30, the earlier displays of "i" have scrolled off the top of the screen. Of course, this happens quite quickly, and will 'appear' to 'start' at '13'.
Run this example. The delay will demonstrate what has happened to the first 12 lines of display.
I hope this helps.
As for your 'scrolling' issue... I'm afraid I may not be your best choice in answers... My simplest answer is, 'I do not know'.
But there are many more people on this forum that are much more clever than myself... It will not take long to get your answer.
J
-
Yes that's how I see it: for scrolling use console, no graphics. For graphics use Screen, no scrolling.
You could probable fake scrolling on a screen with graphics but it'd be some effort.
-
Yes that's how I see it: for scrolling use console, no graphics. For graphics use Screen, no scrolling.
You could probable fake scrolling on a screen with graphics but it'd be some effort.
Even the console scrolls after a certain number of lines; it doesn’t store them all in memory infinity.
Getting all the data you need to display on the screen all at once can sometimes take a good bit of effort by a programmer. What the OP talks about here sounds like a homework problem to help sort that issue out, with the solution being to use commas, print using, tab, or some other method to properly form multiple columns and display a graphic together.
-
Get a B+
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
Another B+
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
WHAT!! No blue?!?! lol...
-
OK blue
[ This attachment cannot be displayed inline in 'Print Page' view ]
-
I generally find it easiest to put whatever you want to scroll into an array, then use a display loop with an offset value controlled by the mousewheel.
If I understand the problem right, you're trying to do something like this...
'Circle and scroll
A(x) = x
offset = 0
CIRCLE (300, 100), 75, &HFFFF0000
-
Oh heck I thought he wanted to do this:
'Circle and scroll
A(x) = x
offset = 0
Circle (300, 300 - offset
* 16), 75, &HFFFF0000
-
For this type issue, I’d just keep it very simple:
SCREEN _NEWIMAGE(640,480,32)
FOR I = 1 TO 40 STEP 2
PRINT USING “#### ####”; I, I +1
NEXT
CIRCLE (300, 300), 100, _RGB32(255, 255, 0)
2 Simple columns of data. One circle.
It’s not going to get much simpler than that.
-
Actually we can create a whole image to scroll up and down:
'Circle and scroll
A(x) = x
offset = 0
I didn't think it this easy!
-
It’s not going to get much simpler than that.
Here is simpler:
Just 1 char more than original.
-
How about scrolling down a moving graphic image?
_Title "Scroll Moving Image" 'b+ 2021-09-19 A(x) = x
offset = 0
rstart = 12
af = 6
Color &HFFBBBBFF, &H00330044 ' transparent background for letters r = rstart
i = 1
i = i + 1
r = r + 5
af = af - .005
_Dest 0 ' update view screen
-
OK blue
Nice. I even like the spiral effect... Cool...
-
thank you guys that was amazing !!! thanx alot
-
There you go. Didn't have to wait too long...
Make full use of the help menu. Work your way through the installed examples. Check out stuff created by these guys. Ask questions.
Have fun and enjoy your stay with us...