Forum Replies Created
-
AuthorPosts
-
You are not supposed to move dynamic bodies this way, it would create/induce very strange things energy/space/time wise. You should destroy it before making it appear somwhere else…
You can find docs with some of these miising things here
http://turdus.be/monkey2docs/docs/
It’s from a fork with WIP docs addons
https://github.com/mx2DocsCommunity/monkey2
the fork is maintained uptodate regularly so if you build from that fork you’ll have latest mx2 with some more docs on core language. It’s not perfect though..
it’s on dev branch of the mx2 github repo…
https://github.com/blitz-research/monkey2/tree/develop
or with a bit more docs
https://github.com/mx2DocsCommunity/monkey2v1.1.05b is also available on itch so I suppose it’s with mojo3d too (and prebuilt)
https://blitzresearch.itch.io/monkey2So now i have to make Color a variaible.
Not really, you may:
[/crayon]Monkey123[crayon-5cbaa117a1a17234739362 inline="true" ]canvas.Color=New Color (0.6,0.7,0.01)This should the equivalent of SetColor(r,g,b)
Ok thanks for the info. Just wanted it to be as identical as possible to original box2D. Will wrap it around then. Don’t know what to do with generics global function though, because they actualy work, so I think I’ll keep them like that until(if) a problem occurs..
I’ve never seen such thing..
And where do I put the downloaded github for ted2go? Do I need to copy these files (all of it?) into the src/ted2go directory?
that’s it: replace the ted2go src dir with the content of the downloaded zip from github then run rebuild*2go script
I just saw in the docs commit of yesterday that extern generic functions can not be imported. Global extern generic functions I tested did work though..
Is there a guide in how to compile/install ted2go?
use terminal and go to monkey2/scripts
then type rebuildted2go on windows
on bash it is ./rebuild2go.sh I think but i’m not sure.(you can use rebuildall2go when using an mx2 github dowload)
I am actually only aiming for ‘useful c++ support’. Full c++ support would be impossible without duplicating all of c++’s features (and quirks)
Operator is a monkey2 feature! (some tokens are not available like ^)
and when I tried to use external operators it looked like it’s almost there. The cpp was showing errors but it’s not far from the good result:
[/crayon]Monkey1234[crayon-5cbaa117b0720299800136 inline="true" ]this->m_s3b.+=this->m_s3.+(this->m_s3b.*(15.0f)); //when a class fieldl_s3b.+=(l_s3.+(l_s3b.*(15.0f))); // when inside a functwich should just be
[/crayon]Monkey1234[crayon-5cbaa117b0727397625907 inline="true" ]this->m_s3b+=this->m_s3+this->m_s3b*15.0f;l_s3b+=l_s3+l_s3b*15.0f;That is just not adding the postfix.member token and not adding the brackets when the method is an operator.
In that regard I thought I would post a feature request as it looks not so hard to implement.The fact that we can add an operator ‘To’ by creating extension is great though, it let us use mx2’s Vec types with that kind of libraries (in my case box2D) without hassle.
My bad. I though Typeof was just returning a string.. Was missing the first lines of the reflexion docs.
what I was looking for was:
[/crayon]Monkey123456789101112131415[crayon-5cbaa117b4909697330664 inline="true" ]Namespace myapp#Import "<std>"#Import "<reflection>"Using std..Function Main()Local arr:=New Int[15,25]Local typ:=Typeof (arr)Print typ.ArrayRankEndI only see how to do it with user defined types..
TypeInfo also includes functions for inspecting all user defined types:
Function TypeInfo.GetType( name:String )
Returns the TypeInfo for a named type. A named type is a namespace or class declared by your app – it does not include primitive types, pointer types, array types etc. Class names must be prefixed by the namespace they are declared in.
To get an array of ALL named types:
Function TypeInfo.GetTypes:TypeInfo[]()
But can we have type info for simple pointers, array…? Some public properties (ArrayRank, PointeeType,..) let me think so but maybe TypeInfo is for user defined only.
[/crayon]Monkey1234567891011121314151617[crayon-5cbaa117ba533976928820 inline="true" ]Function CopyMDArray<T>:T[,](Arr:T[,])Local x:=Arr.GetSize(0)Local y:=Arr.GetSize(1)Local newArr:=New T[x,y]For local i:=0 To x-1For Local j:=0 To y-1newArr[i,j]=Arr[i,j]NextNextReturn newArrEndYou may use a temporary pointer.
Local structPtr:myStruct Ptr
structPtr=varptr myStructInstance
structPtr->x=123Never tried it though..
If you want a non temporary pointer you’ll have to keep your structs alive.I’ve moved the WIP box2d module to a fork of the original box2d because there has been some commits recently so I wanted to be able to udate easily in the future.
I’ll work again on it so If anyone is intersted in teamwork please tell.
https://github.com/abakobo/Box2D -
AuthorPosts