What I mean is:
At first exists BlitzBasic,BlitzPlus,Blitz3D.
Then comes the platformindependent BlitzMax.
Then comes Monkey, which supportes besides the native desktop platforms HTML5, Android, etc.
And now we have Monkey2. Which have what advantages over the first Monkey?
And for every new Programming language / dialect it have to be new written (or ported over ?) the libraries for GUI, 2D, 3D, etc.

So, how API stable is Monkey2?
Or will be soon created a Monkey3?

At the moment Monkey2 looks a lot of different to the C-like languages and to VisualBasic.
I know ANSI-C, Java, QBasic, VisualBasic and so on. And Monkey 2 looks a lot of different.

Mark Sibly (the creator) has stated that he will not create a Monkey3 and will stick with Monkey2.
The biggest problem now is Apple deprecating OpenGL. But porting mojo to vulkan is on the todo list so there’s hope!

Which have what advantages over the first Monkey?

Mark has moved to monkey2 mainly to avoid the hassle of a multi language transcompiler (Monkey1 was transpiling to javascript,c++ & java). It meant a lot of work for each language change. Monkey2 is only transpiling to c++, using the JNI for Android and emscriptem for javascript. So changes are mostly made once for all.
Monkey2 thus has more advanced programming features available such as firstclass functions, mutlithread, incremental garbage collector, class extensions, lambdas, etc..
It is a bit stricter with types too, which helps seeking compilation errors.
If you want fast html5 developpement you might prefer Monkey1 as it has a very fast javascript transcompiler and outputs very nice html5/javascript code.

Monkey2 is clearly lacking of a good beginner tutorial. You can find a lot of simple examples on pakz’s examples pack but there is no real tutorial beginning from 0.

A GUI editor would be awesome!

and what is the “this” (in Java) or “Me” (in VisualBasic) in Monkey 2 ?

Self

You can call a field/method inside a class without
Self if there is no ambiguity.

And how can I set the size of the window? And how can I make it resizable?

To make it resizable use the WindowFlags.Resizable when calling
New. To set the initial size, do it via
New too. (as shown in the example below)

Here is a short example taken from modules/mojox/test folder. It’s the folder where you’ll find simple examples for mojox. Slightly modified to show window size when clicking. You might be confused by the Lambda, it’s just like a function, you could declare the action in a function or method.
Note that mojox is not that easy to get compared to mojo. And if you plan to make a game it is not really advised to use mojox, you should prefer a custom GUI system like the one offered in pyro for example. mojox has been created to create Ted2 initially and only a few people really use mojox, to write their own editors.

I think Monkey2 is for beginners, so it needs an easy start for beginners.
I have in the meantime looked at the calculator example, but your example is a lot easier.
I have a little bit played with it.

A xml description file could look like

XHTML

1

2

3

4

5

6

7

<Control type="Window"name="MyWindow"width="640"heigh="480">

<Property name="WindowFlags"value="Resizable" />

<Control type="DockingView"name="dockingView">

<Control type="Label"name="label"text="Idle"/>

<Control type="Button"name="button"text="Click ME!"/>

</Control>

</Control>

That could be used as intermediate langaue for an GUI-designer. Or as additional language like Microsoft doing it with XAML for its WindowsPresentationFoundation.

This XML-code is only a how it could look like, but currently ignored the

That xml-file should then generate automatically (or compiled to) the file ButtonDemo_ui.monkey2

Monkey

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

#import"<std>"

#import"<mojo>"

#import"<mojox>"

Using std..

Using mojo..

Using mojox..

ClassMyWindow_ui ExtendsWindow

Fieldlabel:Label

Fieldbutton:Button

FielddockingView:DockingView

Method New()

Super.New("Button Demo",640,480,WindowFlags.Resizable)

label=NewLabel("Idle")

button=NewButton("Click ME!")

button.Clicked=Lambda()

button_Clicked()

End

dockingView=NewDockingView

dockingView.AddView(label,"top")

dockingView.ContentView=button

ContentView=dockingView

End

Method button_Clicked()Virtual

End

End

And the written code would then be in the file ButtonDemo.monkey2

Monkey

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#import"ButtonDemo_ui"

ClassMyWindow ExtendsMyWindow_ui

Fieldn:=0

Method button_Clicked()Override

n+=1

label.Text="Clicked #"+n+" window size:"+Width+","+Height

End

End

FunctionMain()

NewAppInstance

NewMyWindow

App.Run()

End

Greetings
theuserbl

0

Author

Posts

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Search for:

Archives

Archives

Recent Replies

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220$100 Bounty: MX2 Running on Samsung's Linux on Dex

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Need Monkey2 logos as .SVG

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

Warning: Cannot modify header information - headers already sent by (output started at /home/monkey2monkeyx/public_html/wp-includes/class.wp-styles.php:242) in /home/monkey2monkeyx/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220Viva Mortis

What is this?

Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.