Forum Replies Created
-
AuthorPosts
-
I also got the same crash when try to type russian chars. There is an russian ‘э’ char on the button with english apostrophe in my keyboard. When I typed <span style=”color: #00ff00;”>э</span> instead of<span style=”color: #00ff00;”> ‘</span> I got a crash. I think you use non-latin apostrophe too. It’s a core monkey’s bug, not the IDE itself. I wrote this issue to Mark.
Attachments:
(And Bool -> String please…)
My MX2 folder also grows and grows after building
Did you delete *buildv* folders generated by previous versions of mx2cc?
To learn how to include app icon on windows, please inspect sources of Launcher
Monkey1\ monkey2 \ src \ launcher \ launcher.monkey2There is a section
Monkey123456789#If __HOSTOS__="windows"'to build resource.o when icon changes...''windres resource.rc resource.o#Import "resource.o"#EndifFile resource.rc contains icon info
Monkey1AppIcon ICON "Monkey2logo.ico"Utility windres.exe is a part of mingw.
@cocon the question was – how to dynamically create (instantiate) copy of any objects (that may contains any components). You just described the design part – how to make such component-based system.
+1.
You can see this dialog window every time you click CODE icon in post reply textarea. There is red line marker on the screenshot to show where Height checkbox is.
Dropbox has Zoom in the bottom of page, image isn’t small.
Screen with Height checkbox https://www.dropbox.com/s/e6wenl8p46eeee3/tempFileForShare.jpg?dl=0
What I want from that community work is to see all these extra docs inside of every monkey release.
How to do that? Just pooling into official repository. I think we can do the merges but after there will be considerable and nice-looking extra docs in this separate repository.
Also there is a wiki sections on github. We can ask Mark to open it. I see a way of using wiki as a temporary buffer for official docs. So anyone can write some useful info there, and Mark can grab suitable texts into official docs/examples.
I consider the wiki as an additional / intermediate resource, but which can live by itself.
Reflection Limitations
Currently, typeinfo is only generated for non-generic, non-extension, non-extern 100% pure monkey2 globals, fields, function, methods, classes and namespaces. You can still use other types (structs etc) with variants etc, but you wont be able to inspect their members.
So, we can’t inspect a very common Vec2 class bcoz it’s generic.
We can ‘solve’ it by using our own version of vector2 together with operator To:Vec2 to mix internal and native vectors.
Reflection..
When (and IF) we have a full reflection support, we can write object Serializer / Deserializer that allow us dynamically creation of any objects, like
Monkey1Local obj := Serializer.FromJson<MyObjType>( jsonStr )This time is impossible to do that.
p.s.
From time to time I’m thinking about building unity-like small editor, and only way I invented for instantiate prefab is
- Generate code with needed properties set – by editor.
- Rebuild sources on start – that’s very sad.
Like this
Monkey12345678910111213141516171819202122232425' autogeneratedFunction Instantiate<T>:T( prefab:T ) Where T Extends EntityLocal obj:Object=NullLocal name:=prefab.InstanceType.NameSelect nameCase "house"obj=Inst_House()Case ...Case ...EndReturn Cast<T>( obj )EndPrivateFunction Inst_House:HouseEntity()Local t:=New HouseEntityt.mass=100t.AddComponent( New Collider )' other inits hereReturn tEndAlso we can add special section in docs something like “< code >….</ code >” and IDE will produce some additional stuff for it like buttons(links) ‘Copy’ and ‘Open in editor’, so we can operate the code inside of IDE.
And many docs / samples we can grab / porting from mx1 (at least keywords description).
Very nice!
One note: looking at these walls of code I have a question – is there way to make code box smaller? And I looked into “code” popup and found “Height” checkbox, that disabled by default.
I didn’t try it yet but it seems to be useful for big code blocks.
Just to refer some docs Mark recently added
https://github.com/blitz-research/monkey2/commit/bedec805fd49eb729a30a792649d73a977f738ea
Nice example. And for docs/samples collection too.
Also there can be a version with ‘outList’ extra parameter to allow users reuse one list for output values. And such variant can return added elements count.
-
AuthorPosts
