Forum Replies Created
-
AuthorPosts
-
Very cool, is there any command to parse numbers from binary? How about creating a binary array?
Some updates, I need to find a way to make “LerpSpeed” function work more natural, now if you notice the object is moving in a “metro-line-style” (X or Y or Diagonal).
… transfered to code forum section …
pressing Tab on multiline selection
I had talked to Mark about it and mentioned that it’s purposefully designed that way. Meaning that only selected lines could be indented.
I did not think of that. Indeed you wouldn’t “trust” the user messing with the original context of mojo in case something goes wrong. Nice one!
I noticed that the special quote character (left from the number 1 on the keyboard – accent grave) used in the documentation is converted into code meta tags due to website configuration. Normally instead of a meta tag it should be like this:
Monkey1@param 'a'… lerp example moved to code forum …
It might be very interesting for an easy and free solution.
Also I would like to try Krita at some point to see if it’s good for making art. These are some groundbreaking techniques.
Hi Mark, I don’t know why are there two gl contexts in your design, one for GLWindow and one for Window. Is it mostly for resource organization? Essentially the BeginGL/EndGL performs that swap.
Monkey12345Method OnRender( canvas:Canvas ) OverrideBeginGL()OnRenderGL()EndGL()EndOn what Adam said, it would be very interesting to use custom user shaders at will. It reminds me of Minecraft where is heavily modded on shaders, beyond any initial plan. I think that this gets closer to a material/shader system (like Unity does).
Here is now a silly hack to make it work, theoretically it should work, but I have not compiled it yet.
In the file mojo.graphics.canvas
Monkey123456789101112131415161718192021222324252627282930313233343536' This is the default shader of the Monkey renderer (only for shapes)Field _shader:Shader' This user shader field is added and two methods as well' to assign/deassign a value to the object.Field _userShader:ShaderMethod EnableUserShader(s:Shader)_userShader = sEndMethod DisableUserShader()_userShader = NullEnd' Then there will be a smart private property to return either the' default shader or the user shader.'Property DefaultShader:ShaderIf _userShader <> Null Then Return _userShaderReturn _shaderEnd' Then all of the methods that use the method AddDrawOp will be changed to use' the smart private property.Method DrawRect( x:Float,y:Float,w:Float,h:Float )Local x0:=x,y0:=y,x1:=x+w,y1:=y+hAddDrawOp( DefaultShader,_material,_blendMode,_textureFilter,4,1 )' etc ...End' For the record this is the actual method that accepts the shader.' perhaps instead of changing ALL of the draw methods that use the AddDrawOp,' the hack could be injected here instead.Method AddDrawOp( shader:Shader,material:UniformBlock,blendMode:BlendMode,textureFilter:TextureFilter,primOrder:int,primCount:Int )Wow! You provided us the whole game, lots of thanks.
If you think that you want a secure, efficient, and modern operating system, you get other ideas. The tables have turned.
I am still amazed by looking at the Blitzmax forums that there are lots of fans of the language still using it.
Wow, basically you can make Ted a multi language editor that way, clever mod.
I would like to add some changes to TED2
You can code anything you want in a “dummy” class (that accepts a string parameter in an update method) and I will be able to convert it to a text view plugin. I had in plans for something like this to create a super lazy variable instantiation, but I had forgot it, I noted it down btw in a TODO list.
If you want to write the plugin write a new class as shown here:
https://github.com/blitz-research/monkey2/blob/master/src/ted2/textviewkeyeventfilter.monkey2In my branch everything is put here:
https://github.com/coconcode/monkey2/blob/experimental-plugins/src/ted2/plugintextview.monkey2What should I do if I want to add support for cpp-coding and replace some filters
At this moment the most easy way to solve it would be this, I consider later on to change the naming conventions back to the original.
Monkey12345678910111213141516171819202122232425262728Class PluginTextViewProtectedField fileTypeSupport:String()EndClass PluginTextView_PluginForCPPAndMonkey Extends PluginTextViewProtectedfileTypeSupport = New String[] ("cpp", "monkey")PublicMethod ValidateFileTypePlugin(fileType:String)'pseudocode 'Return fileTypeSupport.Contains(fileType)EndEnd......Function FilterKeyEvent(event:KeyEvent, textView:TextView)...For Local p := Eachin Plugin.PluginsOfType<PluginTextView>()If event.Eaten Exit' pseudocode 'If p.ValidateFileTypePlugin(MainWindowInstance.GetTheCurrentOpenedTypeFileType)p.OnFilterKeyEvent(event, textView)EndNext@Mark Sibly
Perhaps the TextViewKeyEventFilter plugin should be replaced with a simpler
This makes sense, since it would make plugins more powerful that way, can’t wait to try it.
Now about the status of my work, here are plugins so far.
12345678910111213141516171819202122232425262728PluginTextView_CursorMoveHomeName: "Toggle cursor between the the first word and the start of the current line."Shortcut: "Home"PluginTextView_CursorMoveWordName: "Move cursor to start or end of each the word."Shortcut: "Control(Shift) + Left or Right"PluginTextView_LineCopyCutName: "Copy or Cut a complete line when there is no text selection."Shortcut: "Control + C or X"PluginTextView_LineCommentName: "Toggle comment for lines."Shortcut: "Alt + C"PluginTextView_SelectWordName: "Select a word."Shortcut: "Ctrl + D"PluginTextView_MouseSelectName: "Select text while holding shift and clicking on the text."Shortcut: "Shift + Left Mouse Click"PluginTextView_MouseDoubleClickSelectName: "Select a word by double clicking."Shortcut: "Left Double Click"The only plugin that suffers a bit “PluginTextView_MouseSelect” since you might try to move the mouse a little or release the shift key to actually see the text get selected. (Later on I might try experiement with some async code, perhaps with fibers or timers, who knows. I need that part executed 500ms later after the last event fired so the effect is done. Alternatively, perhaps making the UpdateCursor method of the TextView public and call it might work.)
No more no less there are some other ongoing efforts for creation of cool plugins (if you know any other post it here), a good attempt for cross-contaminating codes.
https://github.com/StrangeIsMyName/monkey2
https://github.com/engor/Ted2Go
-
AuthorPosts