Forum Replies Created
-
AuthorPosts
-
thanks arawkins!
Wow! Didn’t know my browser could render such nice 3D! KUDOS!
Could anybody check the english (and mx2) correctness of the following modification in docs before requesting a pull?
thx
https://github.com/blitz-research/monkey2/compare/develop...abakobo:wipdocs
March 5, 2018 at 10:08 pm in reply to: ANDROID – 3 Onscreen Buttons. LEFT-RIGHT & JUMP. How do I code it? #13887Here’s a short example. Note that there is Touch.FingerDown but also Touch.FingerPressed and Touch.FingerReleased like with the mouse button. (Touch.FingerPressure too on some devices!)
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162Namespace myapp#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends Window'seting up the buttons zones (using recti)Field butLeftRect:=New Recti (10,420,10+90,420+55)Field butRightRect:=New Recti (110,420,110+90,420+55)Field butJumpRect:=New Recti (510,420,510+90,420+55)Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )Super.New( title,width,height,flags )EndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()'Drawing the buttonscanvas.DrawRect(butLeftRect)canvas.DrawRect(butRightRect)canvas.DrawRect (butJumpRect)canvas.Color=Color.Blackcanvas.DrawText("LEFT",20,440)canvas.DrawText("RIGHT",120,440)canvas.DrawText("JUMP",520,440)'Buttons controlcanvas.Color=Color.Redcanvas.DrawText("finger0:"+Touch.FingerLocation(0)+" finger1: "+Touch.FingerLocation(1),10,10)For Local i:=0 To 9If butLeftRect.Contains(Touch.FingerLocation(i)) And Touch.FingerDown( i )canvas.DrawText("LEFT",20,100)EndifIf butRightRect.Contains(Touch.FingerLocation(i)) And Touch.FingerDown( i )canvas.DrawText("RIGHT",120,100)EndifIf butJumpRect.Contains(Touch.FingerLocation(i)) And Touch.FingerDown( i )canvas.DrawText("JUMP",520,100)EndifNextEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndI have bunnies jumping all around on my browser! (perf: 960 bunnies to get 60FPS)
So the pack seems to work! (with python27.dll added)
ok it’s going farther with your python27.dll than with the one I got from winpython 2.7.5.3
(now waiting, module building seems to be ok)
have you ever installed python emscriptem
never ever installed python or emscriptem but now have installed winpython 2.7.5.3 to cath a python27.dll. But it is not copying stuff into windows dirs I think. It’s a standalone package.
I have LLVM in my PATH thoughtried on a free from python/emscrptem W10 and had the following:
Had to unpack the sdk in short named path because in my {desktop}/monkey2-w/devtools the path was too long (so went to C:\devtools). But I suppose you can’t do anything about that.
When trying to build modules for emscriptem I had a W10 promp saying that python27.dll could not be found. I could not find the dll by searching on the disk myself. (
there is pythoncom27.dll and pythoncomloader27.dll but python27.dll is there only in my GIMP and DropBox contents but those two files have diffrent size, so I don’t know wich one to copy!)Edit: I’ve installed WinPython-64bit-2.7.5.3 to try to have a correct python27.dll (it’s 2.7.5150.1013). Then I copied that python27.dll into devtools\emsdk-1.37.35_64bit\python\2.7.5.3_64bit. But then I have this error (on outup console this time).
Shell123456789101112131415161718192021222324252627282930313233343536373839404142434445Mx2cc version 1.1.10***** Making app 'C:/Users/koko/Desktop/monkey2-w/bananas/bunnymark/bunnymark.monkey2' (emscripten release llvm gcc) *****Parsing...Semanting...Translating...Compiling...Build error: System command failed:em++ -c -std=c++11 -Wno-all -s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -O3 -DNDEBUG -I"C:/Users/koko/Desktop/monkey2-w/modules/" -I"C:/Users/koko/Desktop/monkey2-w/modules/monkey/native" -I"C:/Users/koko/Desktop/monkey2-w/bananas/bunnymark/" -I"C:/Users/koko/Desktop/monkey2-w/modules/freetype/freetype-2.6.3/include/" -I"C:/Users/koko/Desktop/monkey2-w/modules/sdl2/SDL/include/" -DBB_NEWREFLECTION -I"C:/Users/koko/Desktop/monkey2-w/bananas/bunnymark/bunnymark.buildv1.1.10/emscripten_release/build/" -o "C:/Users/koko/Desktop/monkey2-w/bananas/bunnymark/bunnymark.buildv1.1.10/emscripten_release/build/_1include_2_0r.cpp_r.o" "C:/Users/koko/Desktop/monkey2-w/bananas/bunnymark/bunnymark.buildv1.1.10/emscripten_release/include/_r.cpp"Traceback (most recent call last):File "C:\devtools\emsdk-1.37.35_64bit\emscripten\1.37.35\\em++", line 15, in <module>python_selector.run(emcc, profile=True)File "C:\devtools\emsdk-1.37.35_64bit\emscripten\1.37.35\tools\python_selector.py", line 40, in runfrom tools.toolchain_profiler import ToolchainProfilerFile "C:\devtools\emsdk-1.37.35_64bit\emscripten\1.37.35\tools\toolchain_profiler.py", line 5, in <module>from tools import response_fileFile "C:\devtools\emsdk-1.37.35_64bit\emscripten\1.37.35\tools\response_file.py", line 1, in <module>import os, loggingFile "C:\devtools\emsdk-1.37.35_64bit\python\2.7.5.3_64bit\lib\logging\__init__.py", line 26, in <module>import sys, os, time, cStringIO, traceback, warnings, weakref, collectionsFile "C:\devtools\emsdk-1.37.35_64bit\python\2.7.5.3_64bit\lib\weakref.py", line 14, in <module>from _weakref import (ImportError: cannot import name _remove_dead_weakref***** Fatal mx2cc error *****Internal mx2cc build errorThis is mainly due to the fact that gcc(mingw) is slow.
Something else is that it compiles all modified files, so if you split well all your code in well structured files, you will gain compile time.
The first two compiles are always slow though, so compiling demos just to see them will always take time. When you work on a project you don’t have the problem anymore.You can use MSVC as your compiler (by installing free msvc studio 2017 community). It’s way faster than gcc.
Once installed you have to modify one/two parameters in env_windows.txt in bin dir:MX2_USE_MSVC=1
and if you want 64bit exe (only available with msvc):
MX2_ARCH_WINDOWS=x64March 4, 2018 at 6:57 am in reply to: ANDROID – 3 Onscreen Buttons. LEFT-RIGHT & JUMP. How do I code it? #13851Have you opened the touchtest banana?
Good choice! 8 price is crazy.
Have a nice plumbing session!Yes and it is not extending Variant so it’s not a Variant:To_String operator, which I have no clue how to get working. But it works fine for my use. As I said, using reflection could help here?
But do you really need to print a lot of other types that these ones? It does not not represent a lot of code in a whole app code.I’m in. (same amount)
I’m doing it this way. If you import reflection there should be a nicer way to do that but I’ve never used reflection so far. So that’s the way I could make it work…
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657Namespace myapp#Import "<std>"Using std..Function Main()Local map:=New StrVarMap()map["key_one"]=15map["key_two"]=15.15map["key_three"]="fifteen"map["key_four"]=Truemap["Vec_a"]=New Vec2f(0,0.1)map["Vec_b"]=New Vec2i(0,0)map["Stack_a"]=New IntStack() 'this one will be unkownPrint mapEndClass StrVarMap Extends StringMap<Variant>Operator To:String()'recording types of interrest (without the use of reflecion, there is probably a better way to do that?)Local variantVec2f:Variant=New Vec2f (0.1,0)Local variantVec2i:Variant=New Vec2i (0,0)Local s:=""For Local node:=Eachin SelfIf s Then s+="~n"s+=node.Key+" =>"If node.Value.Type.Name="Int"s+="(Int): "+Cast <Int>(node.Value)Elseif node.Value.Type.Name="Float"s+="(Float): "+Cast <Float>(node.Value)Elseif node.Value.Type.Name="Bool"s+="(Bool): "+Cast <Bool>(node.Value)Elseif node.Value.Type.Name="String"s+="(String): "+Cast <String>(node.Value)Elseif node.Value.Type=variantVec2f.Types+="(Vec2f): "+Cast <Vec2f>(node.Value)Elseif node.Value.Type=variantVec2i.Types+="(Vec2i): "+Cast <Vec2i>(node.Value)Elses+=node.Value.Type.NameEndNextReturn s+"~n"EndEndIMO the actual Logo is the best that has ever been shown. Just the font of the “2” that I don’t like too much (if something had to be said).
I try to go back to the situation just before it appeared. And then add bits of code until until it comes back. With a lot of “print” everywhere to track the process. Cause the debugger might show too much sometimes. Good luck!
-
AuthorPosts