RetroBASIC

Basicprogramming(.org) => SmallBASIC => Topic started by: chrisws on September 13, 2018, 10:35:41 AM

Title: 0.12.13 Released
Post by: chrisws on September 13, 2018, 10:35:41 AM
SmallBASIC 0.12.13 is now available.

There's not a huge list of changes, but a few nice things.

- Pressing F2 in the editor now loads the help page in the new web site.
- Pressing F11 now toggles full-screen mode.
- Fixed the SEQ bug

Plus some other changes you can read about here:

http://smallbasic.github.io/posts/2018-09-13.html

Cheers,
Chris

PS: Check my new android game "Air cave"


Title: Re: 0.12.13 Released
Post by: B+ on September 13, 2018, 02:24:27 PM
Ah good! Tested window sizing with Johnno's Parallax Image Test mod 2018-02-04 (attached) now mod'd again today.

Oh my full screen is full!, good bye task bar access. f2 works Window (help reference) is under graphics, I guessed System first.

Title: Re: 0.12.13 Released
Post by: B+ on September 13, 2018, 04:02:41 PM
Another test of Window .ask
Code: [Select]
' window ask test.bas SmallBASIC 0.12.13 (B+=MGA) 2018-09-13

w = window()
w.ask("Would you like to test a yes or no question?", "Test a Yes/No Question")
? "You selected ";
if w.answer then print "No." else print "Yes."
pause


Title: Re: 0.12.13 Released
Post by: chrisws on September 17, 2018, 10:54:43 AM
Script BASIC using MsgBox.
I've just build the newest version from source on 32-bit Linux and it seems to work fine. :)

Hi Tomaaz,

If you are okay with building from source code there's something you might like to try:

1. clone or download the SmallBASIC plugins project:
$ git clone https://github.com/smallbasic/smallbasic.plugins.git

2.  build the plugins project
$ ./configure && make

3. setup environment variable SBASICPATH, something like this:
export SBASICPATH=/home/chrisws/src/smallbasic.plugins/nuklear/.libs

4. switch over to your SmallBASIC checkout, then
$ ./configure && make

5. Run the nuklear overview.bas sample:
./src/platform/console/sbasic ../smallbasic.plugins/nuklear/samples/overview.bas

You should see something like the attached image

Here's a link to the overview.bas program:
https://github.com/smallbasic/smallbasic.plugins/blob/master/nuklear/samples/overview.bas


Title: Re: 0.12.13 Released
Post by: Tomaaz on September 30, 2018, 03:50:24 PM
To be honest - I'm not scared of compiling from source, but I wouldn't say I'm a fan. ;) I will try. Is step 4 compiling SmallBasic itself or do I need to do all steps after I have SmallBasic already build?
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 03, 2018, 06:07:53 PM
Doesn't work, unfortunately:

Quote
Opened: overview.bas 3445 bytes


 * COMP-ERROR AT Main:0 *
Description:
Unit nuklear.sbu not found or wrong version

Title: Re: 0.12.13 Released
Post by: chrisws on October 26, 2018, 08:52:04 AM
The error indicates the .so file (equivalent to .dll in windows) was not found in the environment variable SBASICPATH

Could you please try pasting this in the console/bash:

$ env | grep SBASICPATH

Then check to ensure this references the location of where you build the plugin code.
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 26, 2018, 05:36:53 PM
I was able to fix it. It works fine.
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 26, 2018, 05:51:33 PM
But I've tried other examples and it looks like there is something wrong with circle (see screenshot).
Title: Re: 0.12.13 Released
Post by: B+ on October 27, 2018, 07:17:48 AM
Looks like a poor test of DRAWPOLY what is code for that?
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 27, 2018, 04:28:08 PM
Code: [Select]
nk.circle("line", x + 130, y + 140, 110)

When I say "circle" I mean... circle.
Title: Re: 0.12.13 Released
Post by: B+ on October 27, 2018, 05:17:13 PM
Code: [Select]
nk.circle("line", x + 130, y + 140, 110)

When I say "circle" I mean... circle.

If you mean circle why does it say line?  ;D
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 27, 2018, 05:32:50 PM
You can change it to "fill" if you wish, but the resulting circle will be as bad. I thought you were SmallBasic expert here...
Title: Re: 0.12.13 Released
Post by: B+ on October 27, 2018, 06:53:03 PM
Well this "expert" thinks you are NOT showing all of the code sample.
Code: [Select]
rem adapted from love-nuklear example, see: https://github.com/keharriso/love-nuklear.git

import nuklear as nk
color rgb(128,54,0), 1
option predef grmode 304x304

while 1
  if nk.windowBegin("Draw Example", 2, 2, "100%", "100%") then
    [x, y, w, h] = nk.windowGetBounds()
    nk.line(x + 10, y + 40, x + 50, y + 40, x + 50, y + 80)
    nk.curve(x + 50, y + 80, x + 80, y + 40, x + 100, y + 80, x + 80, y + 80)
    nk.polygon("line", x + 100, y + 150, x + 60, y + 140, x + 70, y + 70)
    nk.circle("line", x + 130, y + 140, 50)
    nk.ellipse("fill", x + 30, y + 150, 20, 40)
    nk.arc("fill", x + 150, y + 80, 40, 3 * PI / 2, 2 * PI)
    nk.rectMultiColor(x + 95, y + 50, 50, 50, "#ff0000", "#00ff00", "#0000ff", "#000000")
    'nk.image(img, x + 120, y + 120, 70, 50)
    nk.text("DRAW TEXT", x + 15, y + 75, 100, 100)
  endif
  nk.windowEnd()
wend

Title: Re: 0.12.13 Released
Post by: Tomaaz on October 27, 2018, 07:09:22 PM
I'm showing only the part I have problem with. Do you really think I'm not able to find which part is responsible for that "circle" on the screen? Please, give me some credit. The whole example (and two more) comes with SmallBASIC plugins project, so you can easily test it  yourself.
Title: Re: 0.12.13 Released
Post by: B+ on October 27, 2018, 07:58:04 PM
The problem is in the nuklear code library for circle drawing with lines:

Code: [Select]
REM SmallBASIC 2018-10-27 B+

drawCircleWithLines 300, 200, 150
drawCrappyCircleWithLines 700, 200, 150
input "Try fill press enter...";enter
cls 
for r = 1 to 150 step .1
  drawCircleWithLines 300, 200, r
  drawCrappyCircleWithLines 700, 200, r
next
pause

sub drawCircleWithLines(x, y, r)
  'circumference = 2 * pi * r, now divide that into 1 pixel units n = 2 * pi * r
  n = 2 * pi * r
  for i = 1 to n step .5  ' step 1 or less
    if i = 1 then
      lx = x + r * cos(2 * pi * i / r)
      ly = y + r * sin(2 * pi * i / r)
    else
      cx = x + r * cos(2 * pi * i / r)
      cy = y + r * sin(2 * pi * i / r)
      line lx, ly, cx, cy
      lx = cx : ly = cy
    fi
  next
end

sub drawCrappyCircleWithLines(x, y, r)
  'circumference = 2 * pi * r, now divide that into 1 pixel units n = 2 * pi * r
  n = 2 * pi * r
  for i = 1 to n step 10 '<<<<  to draw crappy circle step by more than 1
    if i = 1 then
      lx = x + r * cos(2 * pi * i / r)
      ly = y + r * sin(2 * pi * i / r)
    else
      cx = x + r * cos(2 * pi * i / r)
      cy = y + r * sin(2 * pi * i / r)
      line lx, ly, cx, cy
      lx = cx : ly = cy
    fi
  next
end

Title: Re: 0.12.13 Released
Post by: Tomaaz on October 29, 2018, 06:27:25 PM
The problem is in the nuklear code library for circle drawing with lines:

What else could it be, my dear Watson? Linux kernel? My monitor? My glasses? ;D
Title: Re: 0.12.13 Released
Post by: B+ on October 30, 2018, 05:03:36 PM
Sorry, just checking that SmalllBASIC hadn't started to screw up, whew! I would miss the excellent circle drawing it provides.
Title: Re: 0.12.13 Released
Post by: Tomaaz on October 30, 2018, 06:06:16 PM
Come on. That was funny.   ;)

- There is something wrong with circle in Nuklear.
- I know what the problem is! Something is wrong with circle in Nuklear.

 ;D ;D ;D