My Community
September 07, 2010, 06:14:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: QB64 is available for 64-bit Linux!  -  QB64 V0.91 for Windows was released on the 31st of July.
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 10
 1 
 on: September 07, 2010, 05:45:46 AM 
Started by Mega - Last post by Galleon
Quote
Is there any plans for a native version of QB64 for the Google Android or any other device that uses Arm Linux?
Not by me at present. It might be something I look into in the future, or others might have some success with this. As a general rule of thumb, if LibSDL is available for that system it is a good bet QB64 can also run on that system.

 2 
 on: September 07, 2010, 04:22:40 AM 
Started by Mega - Last post by fatman2021
.......

 3 
 on: September 07, 2010, 04:16:26 AM 
Started by DarthWho - Last post by DarthWho
Thanks Cy i will try that
and Clippy I am going to test that when I have time.

 4 
 on: September 07, 2010, 04:09:24 AM 
Started by Pete - Last post by DarthWho
I have I am a coastal Studies Major this is the stuff I study sea level is a function of temperature try looking up the medival warm period

 5 
 on: September 07, 2010, 04:05:23 AM 
Started by DarthWho - Last post by Clippy
Does the BI file need to be included after it is compiled?

 6 
 on: September 07, 2010, 03:19:57 AM 
Started by DarthWho - Last post by Cyperium
You can already $include a library (.bas code uncompiled) that will compile along with the rest of your program, just put the SUBs/FUNCTIONs you need in a .bi or .bas file and REM $include it.

 7 
 on: September 07, 2010, 02:55:05 AM 
Started by Cyperium - Last post by Cyperium
To Pete; _DISPLAY is fully compatible with SCREEN 0, as long as you don't use SCREEN 0,0,1,0 (or something to that effect), if you use plain SCREEN 0 and remove any PCOPY 1,0 then I can't think of any reason why it shouldn't display.

I think CTRL + G is a excellent idea and I'll implement that too in the next version (done (used CTRL + L))!

[EDIT:] I have already used CTRL + G for graphical display of the code, I'll use CTRL + L to jump to a Line number (done).

How does the help-engine work?

Also, pressing SHIFT + F6 after you got a error takes you to that line number directly.


To Muffinman; Nice idea, I think I like that better than the word to word approach that QB has, I think I'll implement your version into the next version (done)! You should also have a flag that if help = 1 then nothing should happen cause you move around the help-system using CTRL + left/right/up/down/enter, but you might want to leave it be if you only use the mouse to browse the help.

Also, I think that your code doesn't work correctly with scrolling yet, but it should be easily implemented (if it's not auto-corrected already) (done - it wasn't auto-corrected).

BTW; I already have a CASE for CTRL + left and CTRL + right so your version overrules the help navigation, it's among the last entries on the SELECT CASE, but you don't have to do anything if you navigate using the mouse.

I've decided that in the next version you can only navigate help by using CTRL + up or CTRL + down (and CTRL + ENTER), that way help doesn't interfer with code-navigation using CTRL + left/right (done).

 8 
 on: September 06, 2010, 08:35:26 PM 
Started by Mega - Last post by fatman2021
@Mega
How exactly did you compile your code for the Google Android? Do you know how to produce Arm Linux executables using the windows version of QB64?

@Galleon
Is there any plans for a native version of QB64 for the Google Android or any other device that uses Arm Linux?

 9 
 on: September 06, 2010, 08:22:08 PM 
Started by Cyperium - Last post by Muffinman
Around line 3842 I added this to my copy
Code:
        CASE CHR$(0) + "s" 'ctrl-left
            curx = curx - 5
            IF SHIFT THEN
                IF startx = 0 THEN startx = (curx + 5) + (xrel - 1): IF starty = 0 THEN starty = curpos + yrel - 1: endy = curpos + yrel - 1
                IF startx > 1 THEN endx = (curx - 1) + (xrel - 1)

            ELSE
                startx = 0: endx = 0: starty = 0: endy = 0: selinfo$ = ""
            END IF

        CASE CHR$(0) + "t" 'ctrl-right
            curx = curx + 5
            IF SHIFT THEN
                IF startx = 0 THEN startx = (curx - 5) + (xrel - 1): IF starty = 0 THEN starty = curpos + yrel - 1: endy = curpos + yrel - 1
                IF startx > 0 THEN endx = (curx - 1) + (xrel - 1)
            ELSE
                startx = 0: endx = 0: starty = 0: endy = 0: selinfo$ = ""
            END IF

so that way I can zoom around more than just 1 space when holding ctrl.  Because I gotta zoom man, I gotta zoom you know?..

By the way great stuff there!  Keep it up. :>

 10 
 on: September 06, 2010, 08:02:31 PM 
Started by Muffinman - Last post by Muffinman
I liked codeguy's lotsa rotating poly's program so much I went and spruced it up with an interactive console that's graphically positioned using my layouter program.  You can select polys one at a time and "do stuff".

Run the prog, then edit the first file p-console.png with a paint program.  The black brackets position the visual elements, the writings are just memos - move the brackets about, then save the file and restart the program, & watch if anything moved. :>  See if you can make the first file look like the other file, p-console2.png.  (Try drawing gray lines to use as guides)

Materials: p-console.png, p-console2.png (find the code for the two include files in the first post)

Code:
'$include:'layouterinit.bas'
CONST MaxScreenX = 1366
CONST MaxScreenY = 768
CONST MaxPolys = 511

TYPE PolyRec
   px AS INTEGER
   py AS INTEGER
   radius AS INTEGER
   pc AS INTEGER
   nsides AS INTEGER
   incx AS INTEGER
   incy AS INTEGER
   rotateangle AS INTEGER
   incrotate AS INTEGER
   fill AS INTEGER
   fillstep AS INTEGER
   dosectorlines AS INTEGER
END TYPE
DIM SHARED SinTable(-360 TO 360), CosTable(-360 TO 360), Counts(16, 16)

FOR i = -360 TO 360
    SinTable(i) = SIN(i * 3.1415926535 / 180)
    CosTable(i) = COS(i * 3.1415926535 / 180)
NEXT


DIM console(100, 3) AS LONG

REDIM lay0pointsArr&(2000 ^ 2)
ReadLayout console(), "p-console.png", 0
'scale up the layout (image is half size)
FOR i = 0 TO UBOUND(console, 1): console(i, 0) = console(i, 0) * 2: console(i, 1) = console(i, 1) * 2: NEXT i


bfr& = _NEWIMAGE(1366, 768, 256)
SCREEN bfr&, , 1, 1
scr& = _DEST
_DEST bfr&

DIM Polys(0 TO MaxPolys) AS PolyRec
FOR i = 0 TO MaxPolys
    Polys(i).px = INT(RND * 1366)
    Polys(i).py = INT(RND * 768)
    Polys(i).radius = INT(RND * 32)
    Polys(i).nsides = INT(RND * 16) + 1
    Polys(i).incx = ((-1) ^ INT(RND * 2)) * INT(RND * 8) + 1
    Polys(i).incy = ((-1) ^ INT(RND * 2)) * INT(RND * 8) + 1
    Polys(i).rotateangle = INT(RND * 360)
    Polys(i).incrotate = INT(RND * 9) * (-1) ^ INT(RND * 2)

    '* these are used by drawpoly
    Polys(i).pc = INT(RND * 64) + 32
    Polys(i).fill = -1 '-INT(RND * 2)
    Polys(i).fillstep = INT(RND * 8) + 1
    Polys(i).dosectorlines = -INT(RND * 2)
NEXT

FOR i = -360 TO 360
    SinTable(i) = SIN(i * 3.1415926535 / 180)
    CosTable(i) = COS(i * 3.1415926535 / 180)
NEXT
_FULLSCREEN
IF _FULLSCREEN = 0 THEN _FULLSCREEN _OFF

DIM msg$(10)
selected = -1
DIM prevlmb AS INTEGER, lmb AS INTEGER 'mouse cl tracker
DO
 DO: LOOP WHILE _MOUSEINPUT: prevlmb = lmb: lmb = _MOUSEBUTTON(1)
    CLS
    FOR i = 0 TO MaxPolys

        IF Polys(i).rotateangle > 360 - Polys(i).incrotate THEN
            Polys(i).incrotate = -Polys(i).incrotate
        ELSEIF Polys(i).rotateangle < 0 THEN
            Polys(i).incrotate = -Polys(i).incrotate
        END IF
        Polys(i).rotateangle = Polys(i).rotateangle + Polys(i).incrotate

        IF Polys(i).px > 1366 - Polys(i).incx THEN
            Polys(i).incx = -Polys(i).incx
        ELSEIF Polys(i).px < Polys(i).radius - Polys(i).incx THEN
            Polys(i).incx = -Polys(i).incx
        END IF


        IF Polys(i).py > 768 - Polys(i).incy THEN
            Polys(i).incy = -Polys(i).incy
        ELSEIF Polys(i).py < Polys(i).radius - Polys(i).incy THEN
            Polys(i).incy = -Polys(i).incy
        END IF

        Polys(i).px = Polys(i).px + Polys(i).incx
        Polys(i).py = Polys(i).py + Polys(i).incy
        drawpoly Polys(), i, Polys(i).pc
    NEXT

    '_LIMIT 30
    k$ = INKEY$

    PCOPY 0, 1

    'click check routine
    IF (prevlmb IMP lmb) = 0 THEN

     buttonpressed = 0
     IF CheckPair(console(), 4, _MOUSEX, _MOUSEY) OR CheckPair(console(), 5, _MOUSEX, _MOUSEY) THEN trackmode = 0
     IF CheckPair(console(), 1, _MOUSEX, _MOUSEY) THEN buttonpressed = -1
     IF CheckPair(console(), 3, _MOUSEX, _MOUSEY) THEN buttonpressed = -1
     IF CheckPair(console(), 4, _MOUSEX, _MOUSEY) THEN buttonpressed = -1: msg$(1) = "Attempting contact...": msg$(2) = "  unresponsive": msg$(3) = ""
     IF CheckPair(console(), 5, _MOUSEX, _MOUSEY) THEN buttonpressed = -1: msg$(1) = "": msg$(2) = "arming laser...": msg$(3) = "Ready to fire!"
     IF CheckPair(console(), 6, _MOUSEX, _MOUSEY) THEN buttonpressed = -1: trackmode = -1

     'if a poly is clicked, note the selection
     IF NOT buttonpressed THEN
       prevselected = selected
       selected = findpoly(Polys(), _MOUSEX, _MOUSEY)
       IF selected <> -1 AND selected <> prevselected THEN
           prevselected = selected
           msg$(1) = "Unknown: mysterious entity": msg$(2) = "": msg$(3) = ""
       ELSE
           selected = prevselected
       END IF
     END IF

    END IF
    IF k$ = CHR$(27) THEN selected = -1: prevselected = -1: FOR cclr = 1 TO 3: msg$(cclr) = "": NEXT

    'to draw the console
    _DEST scr&
       IF selected <> -1 THEN
         'draw selection reticle if any selected
         FOR cs = 1 TO 9: CIRCLE (Polys(selected).px, Polys(selected).py), Polys(selected).radius + 6 + cs / 2, _RGB(30, 30, 220), , , 1.1: NEXT
       END IF

       x1 = console(0, 0): x2 = console(1, 0): y1 = console(0, 1): y2 = console(1, 1)

          LINE (x1, y1)-(x2, y2), _RGB(0, 0, 0), BF
          LINE (x1 + 10, y1 + 10)-(x2 - 10, y2 - 10), _RGB(225, 225, 225), B

          IF selected <> -1 THEN
            realpx = Polys(selected).px: Polys(selected).px = (x1 + x2) / 2
            realpy = Polys(selected).py: Polys(selected).py = (y1 + y2) / 2
            drawpoly Polys(), selected, Polys(selected).pc
            Polys(selected).px = realpx
            Polys(selected).py = realpy

          END IF

       IF trackmode AND selected > -1 THEN msg$(1) = "Tracking creature --": msg$(2) = STR$(Polys(selected).px): msg$(3) = STR$(Polys(selected).py)

       'no fancy routines for the rest of the console, yet!
       ShowBunch console(), 3, msg$(1), 1
       ShowBunch console(), 4, "Comm", 2
       ShowBunch console(), 5, "Fire", 3
       ShowBunch console(), 6, "scan", 2
       ShowBunch console(), 7, msg$(2), 2
       ShowBunch console(), 8, msg$(3), 2


     'lastly before swapping _DEST: draw a mouse cursor if needed
     IF _FULLSCREEN > 0 THEN
       ha = 0: hb = 0
       FOR i = 1 TO 5
         IF i MOD 2 = 1 THEN ha = ha + 1 ELSE hb = hb + 1
         LINE (_MOUSEX + ha + 8, _MOUSEY - hb)-STEP(18, 18)
         LINE (_MOUSEX + ha, _MOUSEY - hb)-STEP(15, 15)
         LINE (_MOUSEX + ha, _MOUSEY - hb + 8)-STEP(18, 18)
       NEXT i
     END IF

    _DEST bfr&
    _DISPLAY


LOOP UNTIL k$ > "" AND k$ <> CHR$(27)
SYSTEM


SUB drawpoly (p() AS PolyRec, which, c)
IF p(which).nsides > 0 THEN
    yx = 360 / p(which).nsides
    FOR i = 0 TO 360 STEP yx
        IF p(which).fill THEN
            FOR cr = 1 TO p(which).radius STEP p(which).fillstep
                x1 = p(which).px + cr * CosTable((i + p(which).rotateangle) MOD 360)
                y1 = p(which).py + cr * SinTable((i + p(which).rotateangle) MOD 360)
                x2 = p(which).px + cr * CosTable(((i + p(which).rotateangle) + yx) MOD 360)
                y2 = p(which).py + cr * SinTable(((i + p(which).rotateangle) + yx) MOD 360)
                LINE (x1, y1)-(x2, y2), c
                IF p(which).dosectorlines THEN
                    LINE (p(which).px, p(which).py)-(x1, y1), c
                END IF
            NEXT
        ELSE
            x1 = p(which).px + p(which).radius * CosTable((i + p(which).rotateangle) MOD 360)
            y1 = p(which).py + p(which).radius * SinTable((i + p(which).rotateangle) MOD 360)
            x2 = p(which).px + p(which).radius * CosTable(((i + p(which).rotateangle) + yx) MOD 360)
            y2 = p(which).py + p(which).radius * SinTable(((i + p(which).rotateangle) + yx) MOD 360)
            LINE (x1, y1)-(x2, y2), c
            IF p(which).dosectorlines THEN
                LINE (p(which).px, p(which).py)-(x1, y1), c
            END IF
        END IF
    NEXT
ELSE
    PSET (p(which).px, p(which).py), c
END IF
END SUB


FUNCTION findpoly (p() AS PolyRec, x, y)
'pick the poly closest to where lmb clicked
sr = 20

DIM range(MaxPolys)

FOR i = 0 TO MaxPolys
  range(i) = 100
  IF p(i).px > x - sr AND p(i).px < x + sr AND p(i).py > y - sr AND p(i).py < y + sr THEN
    range(i) = SQR((p(i).px - x) ^ 2 + (p(i).py - y) ^ 2)
  END IF
NEXT i
lowest = 0
FOR i = 0 TO MaxPolys
  IF range(i) < range(lowest) THEN lowest = i
NEXT i
IF range(lowest) >= 100 THEN findpoly = -1 ELSE findpoly = lowest

END FUNCTION

'$include:'layouterfunc.bas'


(I'm ashamed to say this took more than 2 hours to do... they said programming was easy dammit!) And if you ad an ovaloid to the mouse cursor, you can have your own starship Enterprise!

So this shows what sort of things you can do with layouter. Making the layout image only 1/2 as long and tall as the actual screen turned out to be a good idea.  the reading function won't account for that automaticlly though, so you have to multiply the array.  There's limitless possibilities to what else you can do, even though I only put in really simple functions for checking mouse clicks and making boxes show up!

Pages: [1] 2 3 ... 10
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!