Forum Replies Created
-
AuthorPosts
-
August 20, 2016 at 11:57 pm in reply to: Detecting the size of the window automatically outside OnRender? Desktop size? #3269
You don’t need to use a reference to your app (unless you are subclassing) as the global App variable will suffice (as in App.Run() and App.DesktopSize).
There are some examples in mojox/bananas, edit hmm folder is actually named tests.
testbutton.monkey2:
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#import "<std>"#import "<mojo>"#import "<mojox>"Using std..Using mojo..Using mojox..Class MyWindow Extends WindowMethod New()Super.New( "Button Demo",640,480,WindowFlags.Resizable )Local label:=New Label( "Idle" )label.Gravity=New Vec2f( .5,0 )Local button:=New Button( "Click ME!" )button.Clicked=Lambda()Global n:=0n+=1label.Text="Clicked #"+nEndbutton.DoubleClicked=Lambda()Global n:=0n+=1label.Text="Double clicked #"+nEndbutton.RightClicked=Lambda()Global n:=0n+=1label.Text="Right clicked #"+nEndLocal dockingView:=New DockingViewdockingView.AddView( label,"top" )dockingView.ContentView=buttonContentView=dockingViewEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndIf you look over at your debug window you will see Self is null so I think your issue has nothing to do with Vec2f.
Monkey2 does not treat null method calls as an error in debug mode.
It sounds like your xcode tools are wrong.
I would check my steps against readme.txt:
Monkey123456789101112***** Building monkey2 on MacOS/Linux *****1) Install the xcode command line tools. You can do this by entering 'xcode-select --install' in a shell.2) Open a shell and change to the 'monkey2/scripts' directory.3) Enter './rebuildall.sh' and hit return. Wait...4) If all went well, you should end up with a 'Monkey2 (...)' app in the monkey2 directory.5) You should now be able to build and run monkey2 apps. There is a simple 'hello-world.monkey2' test in the monkey2directory, and some simple demos in the '/bananas' directory. Docs can be found at 'docs/index.html'.and maybe version of your as:
Monkey1234567$ as -vApple LLVM version 7.3.0 (clang-703.0.31)Target: x86_64-apple-darwin15.6.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.11.0 -filetype obj -main-file-name - -target-cpu core2 -dwarf-version=2 -fdebug-compilation-dir /Users/simon -dwarf-debug-producer Apple LLVM version 7.3.0 (clang-703.0.31) -mrelocation-model pic -o a.out -IMHO if you want to write quality applications in mobile you use the toolkits provided. Any attempts at a generic implementation fail to leverage the inherent nature of neither and you end up with a useless POC such as QT5 or worse.
That said bindings for QT(quick?) would be extremely nice for monkey2, once reflection is in for monkey2 I would hope someone might be up for that challenge.
I think it should be a pure QT binding, any form of maxgui abstraction would just lower the common denominator further.
Mojox however has chance to catch up to state of the art agnostic desktop applicati0ns such as how Visual Studio Code presents itself. This look is a lot more professional than an app that uses the hosts look and feel.
Monkey12345678910111213141516171819Method Load()_name="dark"_fontSize=16_monoFontSize=16Local obj:=JsonObject.Load( "bin/ted2.config.json" )If objIf obj.Contains( "theme" )_name=obj["theme"].ToString()EndifIf obj.Contains( "fontSize" )_fontSize=obj["fontSize"].ToNumber()EndifIf obj.Contains( "monoFontSize" )_monoFontSize=obj["monoFontSize"].ToNumber()EndifEndifthis snippet is from theme.monkey2[20] and is how ted2 parses it’s config file
I consider ted2 one big monkey2 programming example / banana and study it often.
1 check i had no g++ command in my path (ie command not found)
2 dragged the monkey2-v1.0.0 folder from inside the place the installer put it onto my win7 desktop
3 went to properties of said folder and removed readonly flag and clicked apply
4. waited 10 minutes
5. clicked the monkey in pink, ctrl -n a new file, typed Function Main() print “hello” End
6. pressed F5 then pumped air with fist
The first issue detected is the folder created by 7zip is readonly!
The permission bits on the mx2cc.exe also look like an issue.
back soon…
I had issues with windows monkey2 binaries on my win7 laptop.
I am testing again now…
Thanks cocon. That is an interesting video.
I will look into local midi communications (app to app). In the past Rewire I think was the standard way of doing this?
I would favour the UDP standard OSC as a lot simpler for app to discover and connect with other apps and devices but midi over bluetooth maybe makes midi more relevant again.
In my own app VPaint i have midi control of spin speed and r g b background colour components and really like the feel of real knobs and faders when using an app.
Have you tried running the launcher Monkey2 (Macos).app?
Are you using a plain ~/monkey2 installation folder? It sounds like some kind of permissions issue. Either security or Read and Write folder thing perhaps.
Also there is a tmp folder that monkey2 uses which you may want to check has been created ok in ~/monkey2/tmp.
Mojo does clipping GPU side with Canvas Scissor but it doesn’t do any kind of box culling before that.
I typically DebugStop and step in when I want to understand how mojo is working.
Attachments:
I don’t know how they work under the hood but I think of structs as primitive types.
When you pass ints and floats around their value is copied rather than a pointer to the value being shared.
This is true for structs so I have been able to adopt them happily knowing my managed object count is reduced.
An image is a rectangular area of a texture, and a pixmap is a utility class to abstract complexity of working with various pixel formats.
SDL2 is used as a device manager and it’s drawing API is not used as IMHO mojo2 is superior in design and elegance.
If you want easy I think you should stick with the standard core Monkey2 command set for your initial projects.
I thought LTS releases had 5 years of upgrades.
-
AuthorPosts
