Forum Replies Created
-
AuthorPosts
-
Do you want separated colors for code members like class-names, functions, methods, const, etc?
We have no such stuff yet.
ted2 is out of dated (I suppose), but there is ted2go that is up to date.
Try to start rebuildted2go.sh.
Alias keyword is about types, not members.
For your purposes you can duplicate needed members with good-spelling names and delegate execution to existed ones:
Monkey12345678Class BlahMethod Centre:Vec2f()Return Center() ' just delegating executionEnd MethodMethod Center:Vec2f()Return myCenterEnd MethodEnd ClassCompliler is located at /monkey2/bin/ and named mx2cc_windows / mx2cc_macos.
Just run it w/o params to see the help.
Additional arrays helpers:
ArrayPad() – Returns a copy of the array padded to size specified by size with value ‘value’.
ArrayFill() – Fills an array with ‘count’ entries of the ‘value’.
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849Namespace myapp#Import "<std>"Using std..Function Main()Print "Hello World"Local arr:=ArrayFill( 3,"ok" )For Local i:=Eachin arrPrint iNextPrint "---"arr=ArrayPad( arr,5,"no" )For Local i:=Eachin arrPrint iNextEnd#Rem monkeydoc Returns a copy of the array padded to size specified by size with value 'value'.If value of size is less than or equal to the length of the array then no padding takes place.#EndFunction ArrayPad<T>:T[]( arr:T[],size:Int,value:T )If size<=arr.Length Return arr.Slice( 0 ) ' make a copyLocal result:=New T[size]arr.CopyTo( result,0,0,arr.Length )For Local i:=arr.Length Until result.Lengthresult[i]=valueNextReturn resultEnd#Rem monkeydoc Fills an array with 'count' entries of the 'value'.#EndFunction ArrayFill<T>:T[]( count:Int,value:T )Local result:=New T[count]For Local i:=0 Until countresult[i]=valueNextReturn resultEndI created repository for that:
https://github.com/engor/m2-di-container
Repository contains core class di.monkey2 and two demo programs.
Also I changed code above – FuncWrapper was removed.
PS: such containers are suitable for apps, and much less for games.
Nice looking!
When you draw to canvas, you blend pixels with existing ones.
The question is how to erase pixels in canvas.
It’s actual to make transparent HUD for AR-glasses stuff, when you need to make drawing area actually transparent to see through it.
I remember there was a similar topic but don’t remember the answer – is it possible or is it in TODO.
@cocon thanks! maybe I’ll get something of your code.
There is a little GIF about folding. I almost get it working.
Need to add +/- folding icons into gutter view and checking lines deletion and isertion.
Attachments:
Note about supporting of ARKit is important too, imo.
I donated $25 usd via paypal.
(don’t know is it visible in widget, I just clicked on Donate button in the main page)
I think I can use your realization, for my purposes printing of variant.type.name is enough. Thanks!
It’s good when you have a constatnt range of types.
But you should extend this if-else block for any new type.
A few new kinds of Range is here.
They generate by expression, where single values or ranges are separated by commas,
and ranges min-max diapasons separated by minus-sign.
RangeExprInt – generates sequence of integers , for example: expr=”1,14,20-27″
RangeExprChars – generates sequence of chars, for example: expr=”a-z,A-Z,0-9″
Also there is a Stack extension with method Merge that allow you to merge values into stack to have unique values only.
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455Function RangeExprInt:Int[]( expr:String,sort:Bool=True )expr = expr.Replace( " ", "" )Local arr:=expr.Split( "," )Local st:=New Stack<Int>For Local part:=Eachin arrLocal arr2:=part.Split( "-" )If arr2.Length = 2st.Merge( Range( Int(arr2[0]),Int(arr2[1]) ) )Elsest.Add( Int(part) )EndifNextIf sortst.Sort()EndifReturn st.ToArray()EndFunction RangeExprChars:String[]( expr:String,sort:Bool=True )expr = expr.Replace( " ", "" )Local arr:=expr.Split( "," )Local st:=New Stack<String>For Local part:=Eachin arrLocal arr2:=part.Split( "-" )If arr2.Length = 2st.Merge( Range( arr2[0],arr2[1] ) )Elsest.Add( Int(part) )EndifNextIf sortst.Sort()EndifReturn st.ToArray()EndClass Stack<T> Extension#Rem monkeydoc Add unique values only.#EndMethod Merge( values:T[] )For Local val:=Eachin valuesIf Not Self.Contains( val )Self.Add( val )EndifNextEndEndafter before
sounds interesting
in what editor do you use it? (I want to try it)
-
AuthorPosts
