Forum Replies Created
-
AuthorPosts
-
Ahh, possibly you’re trying to get the size before mojox has actually figured out what size they should be? Try a bit later on in the process after View.OnMeasure has been called (I’m not sure when that is though exactly or if you can hook into it somehow)
That’s right I mean Monkey 1 as a module, the editor is actually written in Blitzmax. So you can use the editor with Monkey 1 and 2, although like I say I haven’t tested Monkey 1 in a while but I can fix bugs if you find any.
The editor can export sprite sheets, but you can also use the effects realtime in your game, so it’s up to what your needs are. There is a Monkey 1 version but I haven’t looked at that in a long time so I don’t know if it’s buggy or not.
Thanks, abakobo, I saw you github issue and fixed that
I’m just using the docs here and trying to figure things out by looking at the source code for Ted2. I think I’ll write a tutorial for mojox once I’ve figured most things out, I like the look of mojox so far I think it’ll be nice to work with.
Regarding the sizes, try using MeasuredSize which is a property that returns a Vec2.
Monkey1234567891011pb=New PushButton("info")Print " pb W:"+pb.MeasuredSize.xPrint " pb H:"+pb.MeasuredSize.ybuttonUP=New Button( "",Image.Load("asset::pad_up.png" ))Print " buttonUP W:"+buttonUP.MeasuredSize.xPrint " buttonUP H:"+buttonUP.MeasuredSize.yI’d be happy to contribute where I can, an open docs system (with invited users) sounds like a good way to go.
I’m just starting to learn mojox too. According to the documents each gadget/widget like buttons has different fields that invoke a method or lambda. Here’s some examples for the code you gave, and my preferred way which would be to extend the element and keep the events separate in their own class (see MyButton below). This is similar to how wxWidgets works. But I’m a newb so maybe someone else can chime in as well
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114#Import "gui/"#Import "<std>"#Import "<mojo>"#Import "<mojox>"Using std..Using mojo..Using mojox..Global virtualResolution:=New Vec2i( 640,480 )Class MyApp Extends WindowField name:TextFieldField check:CheckButtonMethod New( title:String,width:Int,height:Int,flags:WindowFlags=WindowFlags.Resizable )Super.New( title,width,height,flags )Layout="letterbox"'Create Docking ViewsLocal mainview:=New DockingViewLocal dv:=New DockingView'Create ButtonsLocal button:=New MyButton( "OK" )Local buttonUP:=New PushButton( "",Image.Load("asset::pad_up.png" ))Local pb:=New PushButton("info")'Create Check Buttoncheck = New CheckButton()'Create LabelLocal label:=New Label("Enter Text")'Create Text Fieldname = New TextField("",20)'add the above objects to dv docking viewdv.AddView(button,"left")dv.AddView(buttonUP,"left")dv.AddView(check,"left")dv.AddView(label,"left")dv.AddView(name,"left")dv.AddView(pb,"left")'add the dv to the main viewmainview.AddView(dv,"top")' add the mainview to the WindowContentView=mainview'Point to methods in this class for each event.buttonUP.Clicked = OnButtonUpname.TextChanged = OnTextModifiedname.Entered = OnTextEntercheck.Clicked = OnCheckClickedEndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()EndMethod OnMeasure:Vec2i() OverrideReturn virtualResolutionEndMethod OnButtonUp:Void()Print "Button Up Clicked"EndMethod OnTextModified:Void()Print name.TextEndMethod OnTextEnter:Void()Print "Enter Hit: " + name.TextEndMethod OnCheckClicked:Void()If check.CheckedPrint "Checked"ElsePrint "Not Checked"EndEndEnd'You can extend buttons and other things to package events into their own classesClass MyButton Extends ButtonField ICouldBeAnything:StringMethod New( text:String="",icon:Image=Null )Super.New( text,icon )ICouldBeAnything = "Hello!"Clicked = OnClickedEndMethod OnClicked:Void()Print "Clicked! " + ICouldBeAnythingEndEndFunction Main()New AppInstanceNew MyApp( "Examples",640,480 )App.Run()End@pakz TimelineFX has a collisions module with box, line, circle and poly collisions which might be of some use to you.
Happy new year! Good luck with the office, sounds like a positive step
Lots of documentation would be great, make it as easy as possible for people to get started, I’ll hopefully help out there if I get a chance to do tutorials. Looking forward to the youtube vids as well! The admob stuff Xaron mentions is probably high priority as well.
I also think Monkey 2 has loads of potential if you support as many popular libraries/tools as possible (as mentioned in email) – maptilers, sprite animators, physics engines etc., and make a youtube vid for each one about how integrate and use in monkey. It’ll be a great way to build interest and traffic as you’ll be tapping into the audiences and users of those products. But I do think better docs will increase conversion rates. It’s easy to convert old blitz users who already have a good idea, but not so sure about brand new know-nothing-about blitz users.
You said you share an office with a couple of developers who’ve never heard of blitz/monkey, ask them to use monkey 2 and get their feedback if they’re willing. But they’re not allowed to consult with you, they’re only allowed to use what’s available online to figure things out. Might help give you some direction for what needs doing.
For me personally, it’s my 3rd year of freelancing (web developer), and this year I will launch my first WordPress theme. Aim is to earn enough from that and TimelineFX (plus monthly maintenance from a few clients), to just do that full time as building web sites kind of sucks, but they do pay the bills
Merry Christmas all!
I checked back in my Blitzmax version of this code where it works fine but actually Blitzmax loadanimation created each image separately which basically eliminates the problem. So I adjusted my load animation to create separate images instead (which is what I thought was happening anyway until I ran into this issue) and it works perfectly. Looking around the web it does seem like a common issue people face with various hacks to fix. Incidentally this comes close to fixing where you adjust the UpdateTexCoords in the Texture Class like so:
Monkey123456Method UpdateTexCoords()_texCoords.min.x=Float(_rect.min.x+0.5)/_textures[0].Width_texCoords.min.y=Float(_rect.min.y+0.5)/_textures[0].Height_texCoords.max.x=Float(_rect.max.x-0.5)/_textures[0].Width_texCoords.max.y=Float(_rect.max.y-0.5)/_textures[0].HeightEndBut it wasn’t quite perfect, the tiles just didn’t quite line up perfectly but the bleeding was eliminated. Either way I’m happy with separate images for tiles which i notice is what Playniax does as well.
I see thanks. I tried filter nearest and that almost fixes it, but it glitches when y is 0.5. x doesn’t glitch at all. Not sure if that’s correct behaviour? Be nice if nearest was a solution, otherwise I can just try implementing the border technique as outlined in the link.
I’ve attached a working example if anyone wants to test.
Attachments:
To hide the mouse:
Monkey1Mouse.PointerVisible = FalseIt looks like SwapInterval caps at 4 for me, so the lowest FPS I get is 15fps (on windows 10), so it’s hard to tell if it’s slower than it should be. The timer method seems to work well though, with SwapInterval 0.
SwapInterval means:
0 = No Vsync wait at all
1 = 1 Render call per vsync
2 = 1 render call every 2 vsyncs.. and so on. So the higher your swap interval the slower it will render. This is an issue with all games as far as I know. You’ll find that not many FPS players play with vsync on because they want to increase FPS and therefore mouse responsiveness. QuakeLive for example generally caps at 125FPS. But they might also have a way to poll the input at a higher frequency?
I wonder if you can improve the feel of it by using the mouse speed combined with mouse position to have some kind of predictive movement? Just a theory
It’s mainly because of vsync as Jesse says, so the mouse will only be polled at 60hz (or whatever your monitor is). You can disable vsync by adding SwapInterval = 0 in the window constructor which will improve things. I prefer doing this and then using some kind of timing code to separate the rendering and logic to make the game as responsive as possible. Drawback though is the potential for screen tearing as you’re not waiting for a vsync anymore.
-
AuthorPosts