Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 11:04:41 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

NEW LESSON, KBD commands (keyboard)

Pages: [1]
  Print  
Author Topic: NEW LESSON, KBD commands (keyboard)  (Read 2160 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: March 28, 2011, 09:41:47 pm »

Thank you, all, on this,...the code Oldoslover posted works pretty much like what I had in mind, and makes sense, I see the relatiions,  hidden$  ,_NEWIMAGE,
_DEST hidden$ and then that hidden$ is at the end of the _putimage statement,..
so I think I see how it all ties together, and how Screen _newimage establishes a screen, to put everything on. I added some lines of text, and had to make some
small changes, to do that, also added instructions,...
Quote
  Once he gets the text size thing figured out, no doubt he will want to
start rotating it
, actually, for text no, all though interesting idea, but I can't read to well upside down, or side ways, how ever, a image, yes,...but later,
My thoughts now, are to use a DATA map, for the image, but I am not sure, just
"playing around with this", I don't have any plan, it is because when I first saw CY make the letters bigger, in his "hello world" spiral, that cuaght my interest, the variable knd$
Quote
  kbd$ is also just a variable, it is made to hold the contents of the INKEY$ function (which is a string representing the key entered on the keyboard).
This seems to have a lot of uses, changeing size, moveing, jumping ?,...probabley more,I just have not yet thought of.
Here is the changes I made,
Code:
REM
DEFLNG A-Z
PRINT "Instructions, you have about 5 seconds to read this" 'this was just for someone who did not know,which keys to use.
PRINT " Use + to increse sisze , - to decrease size "
SLEEP 4
CLS
SCREEN _NEWIMAGE(800, 600, 32) '<-- this creats it and makes it the active screen.
Hidden& = _NEWIMAGE(100, 160, 32) '<-- very small screen //'note this is where I
'//changed 50 to 160 so the addedtext shows ,actaully each time I added more text
'//I had to increase this.

_DEST Hidden& '<--point to the surface to print on
PRINT "Hello World ­Hola Mundo! "
PRINT "­HOLA!"
PRINT "ALFONSO"
PRINT "How Many "
PRINT "Lines"
PRINT " can I make?"

Size = 0 '<-- set our variable
_DEST 0 '<--reset to point to the surface we see else everything referenced will go to hidden

DO
    _LIMIT 30
    kbd$ = INKEY$
    IF kbd$ = "+" THEN Size = Size + 1 ' call  sub to change the sizes
    IF kbd$ = "-" THEN Size = Size - 1 ' call   "    "     "        "     "
    CLS
    _PUTIMAGE (400 - Size, 300 - Size)-(500 + Size, 350 + Size), Hidden&, 0
    _DISPLAY
LOOP UNTIL _KEYDOWN(27)
 
Dusty, I did look at and save your example  too,...it is interesting to see
Code:
xx = 7 '  set size of enlarged pixels
yy = 8 '
 
the effects of changeing these values, to make it bigger or smaller...
Thanks again everyone.
from Garry
« Last Edit: March 30, 2011, 12:26:09 am by GarrisonRicketson » Report Spam   Logged


Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy