(stupid) question

Monkey Forums/Monkey Programming/(stupid) question

Yahfree(Posted 2011) [#1]
How come I'm getting a syntax error for the following?:


Include "menugui.monkey"


Does monkey include source files differently than Bmax?


DruggedBunny(Posted 2011) [#2]
There's no "Include" -- try "Import".


Yahfree(Posted 2011) [#3]
Import seems to not work as well.

it highlights this line:
		playButton = New nButton(fredimg,200,200,"Play")


saying that it can't find the class "nButton"

Here is menu.monkey:



marksibly(Posted 2011) [#4]
Hi,

Try 'Import menu' - no quotes or .monkey extension.


Yahfree(Posted 2011) [#5]
That worked; however I had to import mojo on the included source aswell, even though the main mojo import was above the source import.

Is this a bug or was it intended?


ziggy(Posted 2011) [#6]
Import scopes are "by file" But Monkey does process properly cyclic imports, so usually, you can place all module imports in your main file, and add an Import main (or whatever name has your main file) in all imported files. Doing so, you get the same results as when using Include in BlitzMax, but in a cleaner way.


Qcat(Posted 2011) [#7]
Nice tip ziggy had not noticed that yet.


Yahfree(Posted 2011) [#8]
Thanks ziggy!

Here's a new question to add to the (stupid) questions list.

How does the game's resolution port across devices? I know that the standard monkey screen is 640x480.. and this is great for flash/html 5, but how does that look on say.. android? How should I make my graphics accordingly, so that it works across any iphone/android?


therevills(Posted 2011) [#9]
Have a look at the auto-fit example in bananas\hitoro\autofit...


Yahfree(Posted 2011) [#10]
Interesting. It compiles correctly on HTML5, but with flash I'm getting a blue screen and a bunch of errors.

Any ideas?


Roger Lockerbie(Posted 2011) [#11]
Have you set your security settings in flash for the directories your working on?


Yahfree(Posted 2011) [#12]
Yeah. It compiles fine to flash when I don't use the virtual resolution stuff.

And the virtual resolution stuff compiles to HTML5 just fine, but when I try to compile to flash using the virtual resolution stuff, it breaks.


Yahfree(Posted 2011) [#13]
Any word on this? It seems broken in Android too.


therevills(Posted 2011) [#14]
Hi Yahfree... Ive just tested the auto-fit example in HTML5, GLFW, Flash and Android - they all work fine here.

What errors are you getting?