Forum Replies Created
-
AuthorPosts
-
Here is a component that combines a scroll bar and a label.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142Class LabelScrollbar Extends DockableViewField Caption:StringField Label:LabelField Scrollbar:ScrollBarField OnValueChanged:Void(value:Int)Property Value:Int()Return Scrollbar.ValueEndMethod New(caption:String, value:Int, min:Int, max:Int)Scrollbar = New ScrollBarScrollbar.Minimum = minScrollbar.Maximum = maxScrollbar.Value = valueScrollbar.ValueChanged = UpdateScrollbarLabel = New LabelCaption = captionUpdateLabel()AddView(Label, "top")AddView(Scrollbar, "top")EndPrivateMethod UpdateScrollbar(value:Int)UpdateLabel()OnValueChanged(value)EndMethod UpdateLabel()Label.Text = Caption + ": " + Scrollbar.ValueEndEndMonkey1234567891011Local radius := New LabelScrollbar("Radius", gProperties.ToolSpray_Radius, 1, 500)radius.OnValueChanged = Lambda(value:Int)gProperties.ToolSpray_Radius = valueEndLocal density := New LabelScrollbar("Density", gProperties.ToolSpray_Density, 1, 500)density.OnValueChanged = Lambda(value:Int)gProperties.ToolSpray_Density = valueEndAddView(radius, "top")AddView(density, "top")Attachments:
Oh, you ‘re saying that I would just use DockingView instead.
It seems that this is what works best.
Monkey123456789101112131415161718192021222324252627282930313233343536#import "<std>"#import "<mojo>"#import "<mojox>"Using std..Using mojo..Using mojox..Class CustomView Extends DockingViewMethod New(a:String, b:String)Local b1 := New Button( a )Local b2 := New Button( b )AddView( b1 ,"top","50%" )AddView( b2 ,"bottom","50%" )EndEndClass MyWindow Extends WindowMethod New()Super.New( "DockingView Demo",640,480,WindowFlags.Resizable )Local dockingView:=New DockingViewdockingView.AddView( New CustomView("LEFT 1", "LEFT 2"),"left","50%" )dockingView.AddView( New CustomView("RIGHT 1", "RIGHT 2"),"right","50%" )ContentView=dockingViewEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndHopefully all of these snippets posted into this forum will be used to create a nice collection of examples.
Hi Nerobot, I had a look at the monkey examples and I figured out that by looking at the “stargate.monkey2” example.
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#import "<std>"#import "<mojo>"#import "<mojox>"Using std..Using mojo..Using mojox..Class CustomView Extends ViewMethod New(a:String, b:String)Local dockingView := New DockingViewdockingView.AddView( New Button( a ),"top","50%" )dockingView.AddView( New Button( b ),"bottom","50%" )AddView( dockingView )EndMethod AddView( view:View )AddChildView( view )_views.Push( view )EndMethod RemoveView( view:View )RemoveChildView( view )_views.Remove( view )EndMethod OnLayout() OverrideFor Local view:=Eachin _viewsview.Frame = RectNextEndField _views:=New Stack<View>EndClass MyWindow Extends WindowMethod New()Super.New( "DockingView Demo",640,480,WindowFlags.Resizable )Local dockingView:=New DockingViewdockingView.AddView( New CustomView("LEFT 1", "LEFT 2"),"left","50%" )dockingView.AddView( New CustomView("RIGHT 1", "RIGHT 2"),"right","50%" )ContentView=dockingViewEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndThis is a reimplementation of what other GUI elements do, such as the Label or something else. For example instead of managing the stack with the views myself I found that I can extend the label and have the same idea.
I think that a new GUI element to be added to mojox, for example currently the hierarchy goes like this: View > Label, View > Button, then this new element would be done like this, View > ViewComponent.
How it should be named? i.e: ViewComponent, ViewNode, ViewControl, etc.
Happy new year with lots of coding!
It looks like this is the place where the users upload their stuff.
https://www.remix3d.comI would imagine only about repeating this concept about 20 times (for about a dozen of gui components). But for scalable code perhaps I will choose the architecture pattern instead. If in the future I will go that way I will post some new code.
Doing a reverse image search revealed this:
I have spotted various interesting websites offering tutorials.
http://www.emanueleferonato.com/
https://www.raywenderlich.com/
https://code.tutsplus.com/courses/search/Games
https://www.codeproject.com/search.aspx?q=game&x=0&y=0&sbo=kwOther thing is from google search where it can lead you to more findings. But personally I have resulted into browsing code repositories and selected a few projects for long term studying (such as the Doom engines).
https://en.wikipedia.org/wiki/List_of_open-source_video_gamesHowever be aware that in order for a tutorial to be easy to follow and study it must be offered as a “recipee” which is small and easy to follow. In order to get deeper into development you will need to get a proper book, and have persistency to follow it from beginning to the end. This is very important because it will take you through all of the aspects of the game, such as gameplay logic, saving-loading progress, level loading etc. One such book I got 5 years ago was this: Beginning iPhone Game Development (2010) which has all of the essential information for making a proper game. Unfortunately now is outdated, so it’s not of any immediate use – due to it was written for Cocos2D and Objective C, but form an academic standpoint the logic and information explained there is proper, it can be ported anywhere. I am sure that there might be other books, but I have not tried anything else, I can’t say for sure about something I don’t know.
vimeo.com/7352498You can think of structuring the knowledge like this: You have the “Recipee” (how the game would look like while played). Then you will need to know the process of stacking a full codebase, how the game as it looks will stick into a larger finished project, these two go hand in hand.
Happy holidays for all.
I resulted into this sort of design. It looks a bit strange but there’s reason for doing it. I want to keep the entire model domain separated – and so on for the view domain. If I start to wrap my primitive datatypes with my own type system, I would probably connect the two domains in the core, while I want to connect them through a thin bridge.
Perhaps in this aspect you would assume I would simply have a manager function, with a beefed up select statement, that does straight value exchange from one place to the other. Well this is also one practical way of doing so, but for now it seems that this lambda approach gives the illusion of flexibility, because later I would create a Map-Database of such bindings ( Bindings:Map<String, Binding> ) in order to handle them by the large.
Monkey123456789101112131415161718192021222324' the class that binds two function callbacksClass BindingField UpdateModel:Void()Field UpdateView:Void()End' setting up the function callbacksbind.UpdateModel = Lambda()Data.Text = textfield.TextEndbind.UpdateView = Lambda()textfield.Text = Data.TextEnd' updating the modelbutton.Clicked = Lambda()bind.UpdateModel()End' updating the viewFunction SomethingHappens()bind.UpdateView()EndLately I have started becoming anti-object oriented, that’s why I try to find functional or metaprogramming-reflection alternatives. In order to minimize declarations and such. However perhaps creating a full project that scales predictably perhaps needs a more streamlined approach as you suggest.
For the iPad vs iPhone debate, I would consider these to be two different categories of products. You will have to think at where people use each device and try to think how your application will fit into these patterns. So grabbing such device will help you get into the testing your application as a simple user.
For building applications, you test anything in the emulator, such as old iOS versions, different devices. Then you can do test deployments up to 5 of your devices. However when you try to release something to the app store things change and the developer account needs to be purchased.
https://apple.stackexchange.com/questions/206123/xcode-7-develop-for-ios-without-developer-accountP.S. Currently I have an iPhone 4 which is the one I am stuck for now. However I am very happy with it, despite the fact that it very old, for using a dozen of specific applications it works fine (i.e. Nanostudio). If I were to purchase a newer model I would go for the iPhone 7 or 8, and only for keeping up with the OS versioning, not so much for the latest hardware features etc.
OK I figured out.
If anyone is interested to use it, perhaps to be added in the mojox tests.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051Namespace myapp#Import "<std>"#Import "<mojo>"#Import "<mojox>"Using std..Using mojo..Using mojox..Class CanvasView Extends ViewMethod OnRender(canvas:Canvas) Overridecanvas.DrawLine(0, 0, Mouse.X, Mouse.Y)EndMethod OnMouseEvent(event:MouseEvent) OverrideApp.RequestRender()EndEndClass MyWindow Extends WindowField mainDock :DockingViewField toolsDock :DockingViewField canvasView :CanvasViewMethod New()Super.New("Paint Application", 1280, 720)mainDock = New DockingViewtoolsDock = New DockingViewcanvasView = New CanvasViewLocal button := New Button("Button 1")toolsDock.AddView(button, "top")mainDock.AddView(toolsDock, "right", 100)mainDock.ContentView = canvasViewContentView = mainDockEndEndFunction Main()New AppInstanceNew MyWindowApp.Run ()EndI tried the Admin technique but nothing happened. But anyway. Trying to see what happens with this dialog, I mentioned it here so Mark can see it.
Testing something…
X
Escaping the character using the preformatted – by opening and closing double grave accent√ Escaping the character ` inside a code html block
X Trying to insert the HTML character id inside the code tag (& # 9 6 <– these are joined, not spaced)
`nerobot, as I try to change the font, I press the button […] the file browser dialog pops up nicely. I try to navigate to C:\Windows\Fonts but there the directory is inaccessible (it tries to render the fonts as it wants with this viewer, instead of displaying simple file list). The workaround is to copy the font from the Windows Fonts location to something else.
Another option is to leave the textbox value open, so I can copy paste the location directly.
-
AuthorPosts
