OP4JS is getting near to completion for each day that passes. We are currently implementing the final project types which are: console and gaming. Yes you read right – console.
Console
A console application under OP4JS is basically a visual project, but where an instance of TW3Console occupies the majority of the screen. It is meant for testing purposes (for now) where you want a quick and easy project type just to test out theories and play around with routines that doesn’t require forms.
We do have more plans for the console in future versions of OP4JS:
- Command registration (think TActions but with params)
- Built in REST command for testing http services
- Pipe output to email
At present the console application supports WriteLn() which outputs both to the screen and to the actual console javascript object. This is handy because it means you can use XCode to see the output “live” if you want to (or any other remote debugger).
Gaming
The generic gaming project type is very simple, basically it puts safari mobile into full-screen, plasters a canvas in the view-port and uses a high-speed timer to force maximum redraw-rate. It is up to you to load in pictures and draw them using the methods in the canvas object.
Since i have coded a lot of 2d platform games earlier, you can expect to see a game library coming out as soon as the product has shipped. In fact it’s one of the things i’m eagerly looking forward to working on.
Is this going to cover just iOS or multiplatform? What about Android and latest Windows Mobile? What about Windows Vista/7 Desktop Widgets? If it is going to be multiplatform, can we target different platforms from the same project? What about database support? Local mobile device database, remote server database, ability to sync local with remote? Implemented in first public version, some version in the future, or no intention to implement it? What I saw so far looks nice, but it would be nice to get answers to these questions to have more clear picture about OP4JS.
Well we have to start somewhere:
1. Our first release is webkit only, with focus on iOS (iphone etc) but compatible with Android.
2. Second release will target Android more clearly, with custom controls that have pure android look & feel
As for the rest, YES.
The first release will not have a database framework, but that is scheduled for SP1.
Most of what you are asking about is actually quite simple. The hard stuff is writing the RTL and IDE (which is growing better for each day).
We have no plans for Internet explorer support but focus on mobile exclusively. Although windows widgets might be supported if it catches on.
What about the input of the console?
Is there some basic ReadLn() support?
This would be very interesting for debugging purpose.
But perhaps a simple GUI with buttons will do it better…
Examples for readLn() is included 🙂
Regarding ReadLn();
On iOS (and android) there is no concurrent way of invoking the keyboard. So what you do is to create an edit-box on the fly (when someone clicks Execute or some other input source):
FEdit:=TW3EditBox.Create(Screen);
FEdit.OnChange:=HandleChange;
And then you dispose of the edit box (hiding the keyboard) again when you are done:
Procedure TMyApplication.HandleChange(Sender:TObject);
Begin
FReadtext:=TW3EditBox(Sender).text;
TW3EditBox(sender).free;
ExecuteCommand(FReadText);
end;
You have pretty much the same freedom here as you would have under Delphi. All visual objects decend from TCustomControl (or TGraphicControl if they are rendered) – and you can add objects, remove them, change parent etc. just like you do in Delphi.
The project types are just there to help you get started. In theory you can create whatever you like.