Forum Replies Created
-
AuthorPosts
-
I found a nice way on how to change the font into something else that Windows has installed.
This command will display a list of the installed font files in the system. Locate the name you want and press Control C to exit the list.
Monkey1dir C:\Windows\Fonts | moreThen copy the font you wish to the location of Ted2Go (or something else that you would like to).
Monkey1copy C:\Windows\Fonts\consola.ttf D:\Monkey2\bin\ted2_windows\assets\fontsThen you will be able to open Ted2Go and locate the font file to this exact location where you copied it.
[Updated Post – I removed the noise from the first post and resulted to this one newest code example]
In this test I try to go with the Variant approach, more or less this is the code design I like the most. The only bummer in this case is when I do right click, it updates the model, but the changes are not transfered back to the textfield. Perhaps I might need to hold a reference to the GUI element as well?
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#Import "<std>"#Import "<mojo>"#Import "<mojox>"Using std..Using mojo..Using mojox..Class Data AbstractGlobal First:String = "Hello"EndClass ModelViewBindingField Model:VariantField View:VariantMethod UpdateModel()Model = ViewPrint("Model Updated: " + TraceVariant(Model))Print(Self)EndMethod UpdateView()View = ModelPrint("View Updated: " + TraceVariant(View))Print(Self)EndMethod SetModel(v:Variant, updateView:Bool = True)Model = vPrint("Model Set: " + TraceVariant(Model))If updateView Then UpdateView()EndMethod SetView(v:Variant, updateModel:Bool = True)View = vPrint("View Set: " + TraceVariant(View))If updateModel Then UpdateModel()EndMethod TraceVariant:String(v:Variant)If v.Type = Typeof<Bool>Return Cast<Bool>(v)Elseif v.Type = Typeof<Int>Return Cast<Int>(v)EndReturn Cast<String>(v)EndMethod To:String()If Model = Null Or View = Null Then Return ""Return "Model: " + TraceVariant(Model) + ", View: " + TraceVariant(View)EndEndClass MyWindow Extends WindowMethod New()Super.New("Example", 640, 480, WindowFlags.Resizable)Local textfield := New TextFieldLocal button := New Button("Left Click - Update Model, Right Click - Update View")Local mainDock := New DockingViewmainDock.AddView(textfield, "top")mainDock.AddView(button, "top")ContentView = mainDockLocal bind := New ModelViewBindingbind.Model = Data.Firstbind.View = textfield.Textbutton.Clicked = Lambda()bind.SetModel(textfield.Text, False)Endbutton.RightClicked = Lambda()bind.SetModel("Time: " + Millisecs(), True)EndEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndSorry for becoming annoying, but if it would be possible for the character “grave accent” to be replaced with something else or be removed.
This is a call for unnecessary changes to the monkey2 documentation engine. Due to the weird and exotic nature of this character, as is it rarely used in both text and technology stuff, web programming folks decided to use it for hardcore website formatting purposes (such as github, online text editors, forum engines).
So this means following a javadoc style of commeting by using various parameters, such as:
Monkey12345678910111213141516@param theVariable:Component The description of the variable which must be a component.^ ^ ^ ^ ^ ^| | | | | || | | | | description starts right after space| | | | || | | | space changes parser state| | | || | | mentioning the type is optional| | || | name of the variable| || space changes parser state||| this is a parameterThanks for mentioning it, I removed the “grave accent” character from doc variables.
(Probably I will have to scroll my posts and fix them all
)
December 11, 2017 at 10:50 pm in reply to: Free way to donate to your favorite content creators #12240I should have bought bitcoins two years ago… :'(
This shader is from some old code where I was learning about GLSL with OpenTK, it renders flat textures.
Monkey12345678910111213141516171819202122232425262728293031var vertexSource = @"#version 330uniform mat4 MVPMatrix;layout (location = 0) in vec3 Position;layout (location = 1) in vec2 Texture;out vec2 InTexture;void main(){gl_Position = MVPMatrix * vec4(Position, 1);InTexture = Texture;}";var fragmentSource = @"#version 330uniform sampler2D Sampler;in vec2 InTexture;out vec4 OutFragColor;void main(){//OutFragColor = vec4(InTexture.x, InTexture.y, 0, 1);//vec4(1);OutFragColor = texture(Sampler, InTexture);}";I had the mood today to try something based on the previous character. You can actually see that I take a different approach to the logo. What are the reasons of doing so? You might ask… I don’t know if it’s good idea or not, only time will tell, once lots of other ideas are gathered, everything goes according to feedback.
My approach on this is design is that (1) how the logo looks and (2) how it looks when is shrinked down. (1) Every sort of project needs a logo that looks good, the problem (as I consider it) with the current monkey is that is more of an abstract representation which is more like a symbol of a monkey rather that the “Monkey Programming Language”. In this case is more of a branding issue. Also regarding for “how it looks when is shrinked” for example see the VSCode logo which looks awful because it has thin lines in it, the Sublime logo otherwise is superb.
And (2) that there should be a logo that is beefed up and looks good at low resolutions, such as websites, computer desktop icons, perhaps mobile devices. The problem with the current logo is that is very detailed and it has thin lines, when this logo is shrinked it becomes blurry and dirty. Especially on windows where the icons are small enough, on the other hand, mac users have better displays with retina resolutions etc…
Some other information regarding this one:
- lots of inspiration from cocos engine logo, so if you need to try your own remix you can look it up
- I made an attempt to move a bit away from the hard pink colors and bring a little red to them
- initially my character did not had hair on-top these come from the cocos logo, I would have to figure out whether to leave the hair or not, in this case I include both versions but open your paint application and do a paint-over to find out yourself
- the name of the font is called “ubuntu title” which is public domain, very important when choosing fonts to search for the licence, I am sure that better fonts can be found, I only spend 30 seconds to get this one because I was in a hurry
- I didn’t mention earlier that the monkey face is purposefully low poly, but this was a year ago when I did experiments in Blender 3D with low poly graphics. Other than that it fits naturally in Monkey 2 because is flatten and low poly logos always look better and they are some sort of a standard. Also when the graphics scale down (at icons) the operating system makes them smooth at preview. Is like getting two for the price of one.
- Finally, this upload is only a preview, is not final, it is only for trying to see what can be done.
Attachments:
Some updates to the code as nerobot suggested.
Monkey1234567891011121314151617181920212223#Import "<std>"Using std.graphicsFunction Main()Local colorSample:UInt = 4294902015Local colorPink := Color.FromARGB(colorSample)Print(colorPink)Local uintPink := Color.ToARGB(colorPink)Print(uintPink)If colorSample = uintPinkPrint("Success")EndEndStruct Color ExtensionFunction ToARGB:UInt(color:Color)Return UInt(color.A * 255) Shl 24 | UInt(color.R * 255) Shl 16 | UInt(color.G * 255) Shl 8 | UInt(color.B * 255)EndEndDecember 2, 2017 at 2:28 pm in reply to: Rotation and Draw Primitives at Virtual Resolutions using native res? #12071This render to texture effect is nice for various purposes, such as pixel art etc.
However for the real deal there should be another much better way. Many others have tried to tackle the problem of virtual resolutions, I remember Diddy Framework (previous monkey-x) had quite a cool way to handle virtual resolutions, that handles scaling, nicely.
My take on the subject so far is to convert values form a range to another.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131Namespace myapp#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class VirtualResolution AbstractGlobal Width:Int, Height:IntFunction Set(width:Int, height:Int)Width = widthHeight = heightEnd#rem monkeydoc Convert an X screen value to virtual.#end remFunction GetVirtualX:Float(screenX:Int)Return Remap(screenX, 0, App.ActiveWindow.Width, 0, Width)End#rem monkeydoc Convert a Y screen value to virtual.#end remFunction GetVirtualY:Float(screenY:Int)Return Remap(screenY, 0, App.ActiveWindow.Height, 0, Height)End#rem monkeydoc Convert an X virtual value to screen.#end remFunction GetScreenX:Float(virtualX:Int)Return Remap(virtualX, 0, Width, 0, App.ActiveWindow.Width)End#rem monkeydoc Convert an X virtual value to screen.#end remFunction GetScreenY:Float(virtualY:Int)Return Remap(virtualY, 0, Height, 0, App.ActiveWindow.Height)End#rem monkeydoc Remap a value from a source range to a target range.#end remFunction Remap:Float(value:Float, firstStart:Float, firstStop:Float, secondStart:Float, secondStop:Float)Return secondStart + (secondStop - secondStart) * ((value - firstStart) / (firstStop - firstStart))EndEndClass Entity AbstractGlobal Position := New Vec2fGlobal TargetPosition := New Vec2fEndClass MyWindow Extends WindowMethod New()Super.New("My Window", 800, 800)VirtualResolution.Set(400, 400)EndMethod OnRender( canvas:Canvas ) Override' game update takes place in the virtual resolutionIf (Mouse.ButtonHit(MouseButton.Left))' the user enters some coordinates that will have to be converted into virtualEntity.TargetPosition.X = VirtualResolution.GetVirtualX(Mouse.X)Entity.TargetPosition.Y = VirtualResolution.GetVirtualY(Mouse.Y)End' the rest is updated normallyEntity.Position.X = Lerp(Entity.Position.X, Entity.TargetPosition.X, 0.05)Entity.Position.Y = Lerp(Entity.Position.Y, Entity.TargetPosition.Y, 0.05)' -------------------------------------------------' on game rendering virtual values must be converted to screen valuesApp.RequestRender()' draw the targetIf True ' <-- sugar to keep method scope cleaner...Local x := VirtualResolution.GetScreenX(Entity.TargetPosition.X)Local y := VirtualResolution.GetScreenY(Entity.TargetPosition.Y)canvas.Color = Color.Redcanvas.DrawLine(0, y, Width, y)canvas.DrawLine(x, 0, x, Height)End' draw the playerIf TrueLocal x := VirtualResolution.GetScreenX(Entity.Position.X)Local y := VirtualResolution.GetScreenY(Entity.Position.Y)canvas.Color = Color.Whitecanvas.DrawRect(x, y, 10, 10)End' -------------------------------------------------' for fun see how the virtual world behavesLocal seeVirtualSpace := TrueIf seeVirtualSpacecanvas.Color = Color.Whitecanvas.DrawRect(Entity.Position.X, Entity.Position.Y, 10, 10)canvas.Color = Color.Bluecanvas.DrawRect(Entity.TargetPosition.X, Entity.TargetPosition.Y, 5, 5)End' -------------------------------------------------EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()End#rem monkeydoc Performs a linear interpolation between two values based on blending value.@param a The original value.@param b The target value.@param blend The blending percentage factor (normalized between 0.0 and 1.0).#endFunction Lerp:Float(a:Float, b:Float, blend:Float)Return blend * (b - a) + aEndPerhaps the only reason to use Steam seems good only for “advertisement” purposes, but practically since the Monkey2 is open source it means that is already offered with the maximum availability ever possible.
But in that light, it means that it would be offered in other places as well App Store (Mac version), Ubuntu Software Center, Windows Chocolatey, etc… Which is again is only for increasing the online presence.
Perhaps there could be two available options for Monkey: One is to complete the puzzle and become one a full-featured-game-making-framework such as providing the essential features as Cocos2DX does. Or it becomes a standalone programming language, that it will start becoming popular in the applications and scientific world.
By becoming a game framework: There is the prospect of the language becoming better but there is still the idea of trying to push the same thing and thus the risk of running in circles.
By becoming a standalone programming language: This is trying something completely new, a completely new demographic, going into a new road with fresh air and fresh ideas.
Perhaps you might have objections to this idea, but you can consider that Mark has already tried game development tools for good since 2003. Now at this point in history things are changed. You can consider that there is so much wide availability in game making technologies, and this leads to saturation of development tools. Monkey will have to fight for survival against the big players in terms of existing “ideology” (which is mostly herd mentality). In game development the big players have defined a prefixed notion how game engines look like and how they should be. (For example this herd mentality is something like: What is this multi-million-company is using? OK I will use it too. What is the most popular game engine? OK if it is used by the 70% of the demographic it means that we are forced to use it too because we don’t want to be left outside.)
By having a general purpose programming language there are lots of possibilities to expand the user base into new areas: Such as IOT, Server, Commercial, Business, Logistics, EShops. Basically Monkey has tremendous interoperability with native C and C++ libraries and this simply makes it useful everywhere in place of C++.
Now if you have the question if non C-esque languages are a deal breaker. I can safely consider that they have lots of potential. There are various tools that are quite popular such as Python or Delphi. Other people are still using VB classic (they even created cults and factions that demand its revival). If you search on indeed.co.uk about Cobol, Fortran, Ada, Pascal you can see that still there is demand for it – even as side knowledge, is still appreciated by managers. So basically it means that people will try to use a programming languages that is best suited in the application domain rather that it would be for name purposes, for example many business applications are written in Delphi due to having proper language constructs in relation to C++ which is highly technical oriented.
However one huge problem with all of the previous programming languages is that they can’t offer the same cool single features as Monkey does. I wonder how is it possible that Monkey is superior to any other programming language and remains so undervalued and unknown, perhaps it business software will give it a second chance.
I don’t know what it would be best, I just throwing some ideas here. However if you know about any technical consultant that would offer some tips of advices, I would be interested to know as well.
October 17, 2017 at 8:03 am in reply to: Is Mark pulling the plug on Monkey2? Worrying comments on Twitter #11141I started using Monkey2 just about last August, from what I know -if I am not mistaken- the technology is almost 1-2 years old, which is almost “nothing” in terms of time. It simply needs more time so more eyes can notice it and be interested to use it. One goal that makes sense is to have about 100 regular members in the forum, another goal is to have 1 game-release per month (this depends on the capability of the users). The more releases there are, the more popularity is increased.
At least on how I think what it would be a nice humble plan to start putting things in place.
I would like it also as well.
Looks great! I can’t wait to try it.
Do you plan to include piano roll and track editing as well?
Also do you plan to release any beta version anytime?Good that it works.
-
AuthorPosts
