Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 79
» Latest member: pedromartins
» Forum threads: 65
» Forum posts: 342

Full Statistics

Online Users
There are currently 4 online users.
» 0 Member(s) | 4 Guest(s)

Latest Threads
Libraries source code
Forum: Questions and discussions
Last Post: cvirus
35 minutes ago
» Replies: 15
» Views: 238
File Scan Version2
Forum: Showcase
Last Post: Marcus
06-18-2018, 01:54 PM
» Replies: 3
» Views: 262
NaaLaa Object Names bug ?...
Forum: Bugs and suggestions
Last Post: Marcus
06-18-2018, 01:44 PM
» Replies: 6
» Views: 94
function bug ???
Forum: Bugs and suggestions
Last Post: Marcus
06-18-2018, 08:59 AM
» Replies: 3
» Views: 59
Rocket Boy
Forum: Showcase
Last Post: pedromartins
06-18-2018, 07:24 AM
» Replies: 9
» Views: 644
procedure bug ???
Forum: Bugs and suggestions
Last Post: pedromartins
06-18-2018, 05:30 AM
» Replies: 0
» Views: 24
if endif bug ???
Forum: Bugs and suggestions
Last Post: Rick3137
06-17-2018, 09:12 PM
» Replies: 1
» Views: 41
Reserved Keywords
Forum: Showcase
Last Post: pedromartins
06-16-2018, 11:54 PM
» Replies: 0
» Views: 27
NaaLaa Editor suggestions
Forum: Bugs and suggestions
Last Post: pedromartins
06-16-2018, 01:26 PM
» Replies: 0
» Views: 30
Mouse off
Forum: Showcase
Last Post: pedromartins
06-16-2018, 10:22 AM
» Replies: 0
» Views: 29

 
  procedure bug ???
Posted by: pedromartins - 06-18-2018, 05:30 AM - Forum: Bugs and suggestions - No Replies

Hi everyone

Because there was a bug with function i got curious and found another possible bug in Naalaa 6 (windows version). [Image: bug.png][Image: wink.png]
So began to test a simple procedure ... and program worked without any errors. Say what ?[Image: smile.png]


Code:
visible:
c

hidden:
a=1
b=2


set color 0,0,0
cls

proc addnum a,b

set color 255,255,255
wln a,"+",b,"=",c


wln "press space to exit"
wait keydown
end

procedure addnum(a,b)
  c=a+b
  'what is this ? no error ? endfunc in procedure ?
endfunc

Print this item

  function bug ???
Posted by: pedromartins - 06-17-2018, 10:29 PM - Forum: Bugs and suggestions - Replies (3)

Hi everyone

Found another possible bug in Naalaa 6 (windows version). Why these things always happen to me ? [Image: bug.png][Image: wink.png]
I was testing a simple function then i thought let's make a crazy thing... and program worked without any errors. Say what ?[Image: smile.png]





Code:
a=1
b=2

set color 0,0,0
cls

c=addnum(a,b)
set color 255,255,255
wln a,"+",b,"=",c


wln "press space to exit"
wait keydown
end

function addnum(a,b)
  c=a+b
  return c
  'what is this ? no error ? endproc in function ?
endproc

Print this item

  Reserved Keywords
Posted by: pedromartins - 06-16-2018, 11:54 PM - Forum: Showcase - No Replies

Hi everyone

Made a program that lists NaaLaa reserved keywords. Hope you enjoy. [Image: smile.png]

Code:
'NaaLaa reserved keywords

import "Keycodes.lib"

constant:
  SCREENWIDTH 640
  SCREENHEIGHT 480

visible:
rwords$[175]


hidden:

rwords$[0]="abs"
rwords$[1]="acos"
rwords$[2]="active"
rwords$[3]="additive"
rwords$[4]="and"
rwords$[5]="AND"
rwords$[6]="asc"
rwords$[7]="asin"
rwords$[8]="atan"
rwords$[9]="atan2"
rwords$[10]="break"
rwords$[11]="caret"
rwords$[12]="cels"
rwords$[13]="center"
rwords$[14]="chdir"
rwords$[15]="chr"
rwords$[16]="clear"
rwords$[17]="clip"
rwords$[18]="cls"
rwords$[19]="color"
rwords$[20]="colori"
rwords$[21]="colorkey"
rwords$[22]="cols"
rwords$[23]="constant"
rwords$[24]="cos"
rwords$[25]="create"
rwords$[26]="datafolder"
rwords$[27]="date"
rwords$[28]="debug"
rwords$[29]="decimal"
rwords$[30]="degrees"
rwords$[31]="disable"
rwords$[32]="do"
rwords$[33]="download"
rwords$[34]="downto"
rwords$[35]="draw"
rwords$[36]="ellipse"
rwords$[37]="else"
rwords$[38]="elseif"
rwords$[39]="enable"
rwords$[40]="end"
rwords$[41]="endfunc"
rwords$[42]="endif"
rwords$[43]="endproc"
rwords$[44]="eof"
rwords$[45]="exists"
rwords$[46]="false"
rwords$[47]="fheight"
rwords$[48]="file"
rwords$[49]="float"
rwords$[50]="font"
rwords$[51]="for"
rwords$[52]="free"
rwords$[53]="function"
rwords$[54]="fwidth"
rwords$[55]="grid"
rwords$[56]="height"
rwords$[57]="hidden"
rwords$[58]="hraster"
rwords$[59]="hscroll"
rwords$[60]="if"
rwords$[61]="image"
rwords$[62]="import"
rwords$[63]="include"
rwords$[64]="inkey"
rwords$[65]="instr"
rwords$[66]="int"
rwords$[67]="joybutton"
rwords$[68]="joyx"
rwords$[69]="joyy"
rwords$[70]="justification"
rwords$[71]="keydown"
rwords$[72]="left"
rwords$[73]="len"
rwords$[74]="line"
rwords$[75]="load"
rwords$[76]="loop"
rwords$[77]="lower"
rwords$[78]="max"
rwords$[79]="mid"
rwords$[80]="min"
rwords$[81]="mouse"
rwords$[82]="mousebutton"
rwords$[83]="mousex"
rwords$[84]="mousey"
rwords$[85]="music"
rwords$[86]="next"
rwords$[87]="not"
rwords$[88]="off"
rwords$[89]="on"
rwords$[90]="open"
rwords$[91]="openfile"
rwords$[92]="or"
rwords$[93]="OR"
rwords$[94]="pixel"
rwords$[95]="pixeli"
rwords$[96]="play"
rwords$[97]="poly"
rwords$[98]="polyf"
rwords$[99]="pop"
rwords$[100]="primary"
rwords$[101]="proc"
rwords$[102]="procedure"
rwords$[103]="projection"
rwords$[104]="push"
rwords$[105]="radians"
rwords$[106]="randomize"
rwords$[107]="read"
rwords$[108]="read16"
rwords$[109]="read32"
rwords$[110]="read8"
rwords$[111]="readf"
rwords$[112]="reads"
rwords$[113]="rect"
rwords$[114]="redraw"
rwords$[115]="rem"
rwords$[116]="return"
rwords$[117]="right"
rwords$[118]="rln"
rwords$[119]="rnd"
rwords$[120]="rotate"
rwords$[121]="rows"
rwords$[122]="run"
rwords$[123]="save"
rwords$[124]="savefile"
rwords$[125]="scale"
rwords$[126]="screenh"
rwords$[127]="screenw"
rwords$[128]="scroll"
rwords$[129]="set"
rwords$[130]="shellexecute"
rwords$[131]="SHL"
rwords$[132]="SHR"
rwords$[133]="sin"
rwords$[134]="sizeof"
rwords$[135]="sound"
rwords$[136]="split"
rwords$[137]="sqr"
rwords$[138]="stop"
rwords$[139]="str"
rwords$[140]="system"
rwords$[141]="tan"
rwords$[142]="td_cam"
rwords$[143]="td_fog"
rwords$[144]="td_frustrum"
rwords$[145]="td_quad"
rwords$[146]="then"
rwords$[147]="time"
rwords$[148]="to"
rwords$[149]="transformation"
rwords$[150]="translate"
rwords$[151]="true"
rwords$[152]="until"
rwords$[153]="upper"
rwords$[154]="visible"
rwords$[155]="volume"
rwords$[156]="vraster"
rwords$[157]="vscroll"
rwords$[158]="wait"
rwords$[159]="wend"
rwords$[160]="while"
rwords$[161]="width"
rwords$[162]="window"
rwords$[163]="wln"
rwords$[164]="write"
rwords$[165]="write16"
rwords$[166]="write32"
rwords$[167]="write8"
rwords$[168]="writef"
rwords$[169]="writes"
rwords$[170]="zone"
rwords$[171]="zoneh"
rwords$[172]="zonew"
rwords$[173]="zonex"
rwords$[174]="zoney"

set color 0,0,0
cls
set window 0, 0, SCREENWIDTH, SCREENHEIGHT, false, 2
set redraw off

idx=-1
n=0
s=0
event=1
do

  if event=1
    idx=idx+1
    if idx>174
      idx=0
    endif
    n=n+1
  endif
 
  if n>25
    event=0
    n=0
    idx=idx-1
    set color 255,255,255
    wln
    wln "[SPACE]-Continue  [ESC]-Quit"
  endif

  if event=1     
    set color 0,255,0
    wln idx+1," - ", rwords[idx]
  endif

  if inkey(0)=32
    set color 0,0,0
    cls
    set caret 0,0
    event=1
  endif

  if inkey(0)=27
    s=1
  endif

  redraw
 
until s=1
end

Print this item

Bug if endif bug ???
Posted by: pedromartins - 06-16-2018, 06:51 PM - Forum: Bugs and suggestions - Replies (1)

Hi everyone

Found this is when compiling a small test program. It compiled without errors. I think it's the endif of the world [Image: bug.png][Image: wink.png] (NED 1.1.3 windows)


Code:
a=1
if a=1
  wln a
endif
'say what ?
endif

wln "press space to exit"
wait keydown
end

Print this item

  Libraries source code
Posted by: pedromartins - 06-16-2018, 01:42 PM - Forum: Questions and discussions - Replies (15)

Hi everyone

Is the source code from libraries .lib available ? I want simplewidget.lib so bad. BIG LOL[Image: tongue.png]
If the answer is no. Well i understand too. It's people's work.

I saw the use of simplewidget.lib in the NaaLaa tool applications. I am thinking of doing an application with a window system from scratch.
I need good start idea and then evolve.

A nice day to everyone.

Print this item

  NaaLaa Editor suggestions
Posted by: pedromartins - 06-16-2018, 01:26 PM - Forum: Bugs and suggestions - No Replies

Hi everyone

Starting these suggestions by saying these are just a suggestions. Not for doing right now or tomorrow.
Just for doing when people have the time and wish to do it. I don't want people to think that i am imposing things.[Image: smile.png]

1 - I want a section named "NaaLaa Editor" in forum where you can put everything about the naalla editor: sugestions, new features

2 - I want an option in menus to comment/uncomment blocks of code

3 - I want an option in menus on/off code line numbers



PS: Marcus what i want is just a suggestion ok. Not imposing things. You can do it or not. Friends either way.[Image: smile.png]

Print this item

  Mouse off
Posted by: pedromartins - 06-16-2018, 10:22 AM - Forum: Showcase - No Replies

Hi everyone

Making some mouse studies in NaaLaa. Glade to share this code. Feel free to improve it. [Image: smile.png]


Code:
import "keycodes.lib"

constant:
  MOUSE_LEFT 0
  MOUSE_RIGHT 1
  SCREENWIDTH 640
  SCREENHEIGHT 480

hidden:

set window 0, 0, SCREENWIDTH, SCREENHEIGHT, false, 2
set redraw off
set color 0,0,0
cls

eventmouseleftbuttonpressed=0
eventmouserightbuttonpressed=0

set mouse off
set mouse SCREENWIDTH/2, SCREENHEIGHT/2

do  
  mx=mousex()
  my=mousey()

  if mousebutton(MOUSE_LEFT)
    eventmouseleftbuttonpressed=1
  else
    eventmouseleftbuttonpressed=0
  endif

  if mousebutton(MOUSE_RIGHT)
    eventmouserightbuttonpressed=1
  else
    eventmouserightbuttonpressed=0
  endif
 
  if eventmouseleftbuttonpressed=1 and eventmouserightbuttonpressed=0
    set color 0,0,0
    cls
    set color 0,255,0
    set caret 10,10
    wln "mouse left button: ON"
    draw ellipse mx, my, 20, 20, 1
    set color 255,0,0
    set caret 10,20
    wln "mouse right button: OFF"
  endif

  if eventmouseleftbuttonpressed=0 and eventmouserightbuttonpressed=1
    set color 0,0,0
    cls
    set color 255,0,0
    set caret 10,10
    wln "mouse left button: OFF"
    set color 255,0,255
    set caret 10,20
    wln "mouse right button: ON"
    set color 255,0,255
    draw ellipse mx, my, 10, 10, 1
  endif

  if eventmouseleftbuttonpressed=1 and eventmouserightbuttonpressed=1
    set color 0,0,0
    cls
    set color 0,255,0
    set caret 10,10
    wln "mouse left button: ON"
    set color 0,255,0
    draw ellipse mx, my, 20, 20, 1

    set color 255,0,255
    set caret 10,20
    wln "mouse right button: ON"
    set color 255,0,255
    draw ellipse mx, my, 10, 10, 1
  endif

  if eventmouseleftbuttonpressed=0 and eventmouserightbuttonpressed=0
    set color 0,0,0
    cls
    set color 255,0,0
    set caret 10,10
    wln "mouse left button: OFF"
    set color 255,0,0
    set caret 10,20
    wln "mouse right button: OFF"
  endif

  set color 255,255,255
  draw ellipse mx, my, 20, 20, 0

  redraw
until keydown(VK_ESC) or not running()

Print this item

  Pressing mouse buttons
Posted by: pedromartins - 06-16-2018, 09:34 AM - Forum: Showcase - No Replies

Hi everyone

Making some mouse studies in NaaLaa. Glade to share this code. Feel free to improve it. I am a complete newbie [Image: smile.png]


Code:
import "Keycodes.lib"

constant:
  MOUSE_LEFT 0
  MOUSE_RIGHT 1
  SCREENWIDTH 640
  SCREENHEIGHT 480

hidden:

set window 0, 0, SCREENWIDTH, SCREENHEIGHT, false, 2
set redraw off
set color 0,0,0
cls

eventmouseleftbuttonpressed=0
eventmouserightbuttonpressed=0

do  
  if mousebutton(MOUSE_LEFT)
    eventmouseleftbuttonpressed=1
  else
    eventmouseleftbuttonpressed=0
  endif

  if mousebutton(MOUSE_RIGHT)
    eventmouserightbuttonpressed=1
  else
    eventmouserightbuttonpressed=0
  endif
 
  if eventmouseleftbuttonpressed=1 and eventmouserightbuttonpressed=0
    set color 0,0,0
    cls
    set color 0,255,0
    set caret 10,10
    wln "mouse left button: ON"
    set color 255,0,0
    set caret 10,20
    wln "mouse right button: OFF"
  endif

  if eventmouseleftbuttonpressed=0 and eventmouserightbuttonpressed=1
    set color 0,0,0
    cls
    set color 255,0,0
    set caret 10,10
    wln "mouse left button: OFF"
    set color 0,255,0
    set caret 10,20
    wln "mouse right button: ON"
  endif

  if eventmouseleftbuttonpressed=1 and eventmouserightbuttonpressed=1
    set color 0,0,0
    cls
    set color 0,255,0
    set caret 10,10
    wln "mouse left button: ON"
    set color 0,255,0
    set caret 10,20
    wln "mouse right button: ON"
  endif

  if eventmouseleftbuttonpressed=0 and eventmouserightbuttonpressed=0
    set color 0,0,0
    cls
    set color 255,0,0
    set caret 10,10
    wln "mouse left button: OFF"
    set color 255,0,0
    set caret 10,20
    wln "mouse right button: OFF"
  endif

  redraw
until keydown(VK_ESC) or not running()

Print this item

  Creating images with transparency
Posted by: Marcus - 06-16-2018, 07:29 AM - Forum: Showcase - Replies (3)

In response to http://www.naalaa.com/community/showthread.php?tid=74, I explained that 'set pixel' can be used for creating images with transparency. Here's a small example where I do just that:

Code:
import "Keycodes.lib"

' Create a fuzzy brush.
brushSize = 59

create image 1, brushSize, brushSize
set image 1
radius# = float(brushSize)*0.5
for y = 0 to brushSize - 1
    for x = 0 to brushSize - 1
        dx# = float(x) - radius
        dy# = float(y) - radius
        d# = sqr(dx*dx + dy*dy)
        alpha# = max(1.0 - d/radius, 0.0)
        set color 255, 255, 255, int(alpha*255.0)
        set pixel x, y
    next
next
set image primary

set redraw off
do
    ' Draw some random fuzzy circles.
    for i = 1 to 100
        set color rnd(255), rnd(255), rnd(255), rnd(64)
        draw image 1, rnd(640) - brushSize/2, rnd(480) - brushSize/2
    next
    ' Clear screen with an alpha value of 4.
    set color 0, 0, 0, 12
    cls
    scroll 0, -1
    ' Draw brush at mouse position.
    set color 255, 255, 255
    draw image 1, mousex() - width(1)/2, mousey() - height(1)/2

    ' Redraw and wait.
    redraw
    wait 16
until keydown(VK_SPACE, true)

Print this item

  set pixel bug ???
Posted by: pedromartins - 06-15-2018, 11:29 PM - Forum: Bugs and suggestions - Replies (2)

Hi everyone

set pixel doesn't respond to set color 4th parameter ? set color r,g,b,a
Is this a bug[Image: bug.png] ?

With draw color it responds if you change a ,that is 125, to 255. It becomes more bright.

Do i have to use set colori with it ? don't know how to include a ...[Image: sad.png]

set colori (rnd(100) SHL 16) + (rnd(255) SHL 8) + rnd(100)  --> this is only for color rgb not for color rgba



Code:
'grass

constant:
  SCREENWIDTH 640
  SCREENHEIGHT 480

hidden:

set window 0, 0, SCREENWIDTH, SCREENHEIGHT, false, 2
set redraw off
set color 0,0,0
cls

'draw matrix to screen
for y = 0 to SCREENHEIGHT-1
  for x= 0 to SCREENWIDTH-1
    set color rnd(100),rnd(255),rnd(100),125
    rem set pixel x,y
    draw pixel x,y
  next
next
redraw

set color 255,255,255
wln "Press space key to exit ..."

redraw

wait keydown

end

Print this item