Category Archives: Xojo

ABXPlay for Xojo is dead, long live ABMXPlay for B4J!

abmxplaylogo

As many will have noticed in the last year,  there are fewer articles about Xojo on Alwaysbusy’s Corner.  I do like to write graphics projects/frameworks and Xojo is more a language for business apps. Over the years, I’ve written several ‘Proof of Concept’ articles on graphics programming with RB/Xojo.  And although the algorithms could be written, I always quickly hit a wall when it came to speed. I sometimes get requests to update the existing articles, but IMHO, Xojo is becoming the new VB6.  Just like at the end of the popular VB6, using declares in Xojo are in many cases the only solution to make your program work in a modern way.

But it has been fun and I’m sure Xojo can be used to write several other type of projects. I have no regrets having learned RB/Xojo in the past.

But in this view, I have discontinued the ABXPlay for Xojo project and decided to start all over again with ABMXPlay for B4J as a ABMaterial 2.0 component. B4J is excellent when it comes to pure speed in WebApps and that is exactly what is needed for a game framework.

The complete rewrite of ABMXPlay for B4J is better than the Xojo version.  It is integrated in ABMaterial so it can make use of this engine too.  As the B4J syntax is a lot easier than the one in Xojo to interpret (it is very similar to what RB used to be) and the used file format is plain text, I’m working on a B4JS transpiler that will translate B4J code to Javascript.  This changes everything massively!  While still being able to write simple Basic syntax, you are actually writing powerful and fast client side Javascript.

ABMXPlay is going to be the first ABMaterial component with this functionality. In the following months, I’ll gradually will introduce this to other ABMaterial components as they can equally benefit from B4JS. Imagine having a form, being able to check the input fields, making some price calculations etc without having to talk to the server.  Only when the user hits the ‘buy’ button, an actual request is made to the server.  And for you as a programmer, all you have to do is continue programming in B4J as you always did!

So, still a lot of work to do. Coffee and Red bull will be my best friends in the upcoming nights. But it is going to be worth it!

Note: ABXVision for Xojo is also DISCONTINUED: Interested parties in purchasing the source code for the Xojo versions can contact me via email.

Until the next update,

Alwaysbusy

Click here to Donation and support ABMaterial


Xojo: CHIP-8 Emulator

CHIP-8
Some weeks ago, Ashot Khachatryan contacted me on the Xojo forum with the question if I would be interested in writing a CHIP-8 Emulator in Xojo. I had no knowledge of the system and he had written a good part of an Emulator himself. It had some hard to find bugs in it and he was kind of stuck. As it is hard to debug someone elses code, especially if the subject is not very well known, I decided to start from scratch. Or, to say it in Barney Stinsons words, Challenge accepted!

CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for said computers. Input is done with a hex keyboard that has 16 keys which range from 0 to F. The ‘8’, ‘4’, ‘6’, and ‘2’ keys are typically used for directional input.

There are a number of classic video games ported to CHIP-8, such as Pong, Space Invaders, Tetris, and Pac-Man.

So, the big question was, could we write a CHIP-8 CPU Emulator in Xojo? It needs to be able to read ROMS, interpret Opcodes, show it on the 64×32 pixels screen and handle input. An Opcode is a two bytes code like 00E0 (Clears the screen).

The ‘Virtual Machine’ ABCH8CPU would need to handle a couple of things:
Screen: a picture of 128×64 pixels
Memory: 4096 bytes. I decided a memoryblock would be ideal in Xojo to handle this
Registers: a CHIP-8 has 16 8-bit registers (V0-VF). A Byte array will be used
Timers: a byte array of size 2
Sound: Beep is used
Input: the Keyboard.AsynckeyDown() method would handle the state of the 16 keys.

There are a number of projects on the net in other programming languages available. (Just google CHIP-8 source code). I’ve studied several of them before I’ve wrote my Xojo version.

Here is the result (didn’t spend much time on the GUI):

ABChip8
It can handle CHIP ROMs and SCHIP (Super CHIP) ROMs. Unfortunately, speed is terrible. Xojo may not have been the right language to write this project in, but look at it as a proof of concept. And it can probably be optimized too, as I wrote this emulator in an evening or two.

You can change the keyboard (AZERTY/QUERTY) to emulate the 16-Keys keyboard. A memory dump and a list with the interpreted Opcodes is also shown.

All in all, this was a fun project to do!

The Xojo source code and some ROMs: http://gorgeousapps.com/ABCHIP8.zip

Bye for now!

Alwaysbusy

Click here to Donation if you like my work


Xojo: Release 2014R3 with iOS support

Xojo with iOS support
We are spoiled this Christmas! Xojo has released a new update of their cross-platform development tool, and this time it includes a new one: iOS.

I think congratulations is in order to the Xojo dev team! The wait has been long and there are a lot of eager programmers wanting to explore the world of mobile development. There are some changes in the framework that will it make somewhat harder for hardcore developers (me included) who have already huge business logic libs. But I’m sure the Xojo community will come up with some tricks to make the transition faster.

Already some members are trying to set-up some kind of central place to cover some missing controls/functionalities with Declares. I hope they share the source code, so we can all learn from it!

Here is what the wizards of Xojo have to say:

Xojo, Inc.:
Latest release allows users to create high-quality, native iOS applications in the same way they develop desktop and web apps today.

Xojo users can now build iOS apps in the same way desktop and web applications are created. Users can drag and drop to create the user interface and use one straight-forward programming language to implement the functionality of their app. Xojo makes it significantly faster and easier to create native iOS apps than any other tool. Many iOS business apps rely on a web-based server application that provides business logic and database access. Xojo is the only development tool that provides the ability to create both a native iOS client application and a native server application from a single language and tool. Users experience true multi-platform development with Xojo, creating their app on one platform and delivering a completely native product to users on another platform.

Geoff Perlman (Xojo Founder and CEO):
“Xojo 2014 Release 3 represents a huge leap forward for us as we are now have a mobile development platform. Adding iOS to Xojo has been the top feature request from our users and we are pleased to deliver. By expanding their Xojo applications from the desktop and web to iOS, our developers are now able to broaden their target audience to a whole new range of prospects.”

This latest release adds 160 improvements and over 20 new features. In addition to the new iOS framework, this release also adds improvements to the web framework and includes new classes that make creating international applications easier. Further, web applications can now respond to requests from search engines such as Google, making their content searchable on the web.

Xojo 2014 Release 3 feature highlights include:

  • New iOS framework.
  • New Text data type and supporting methods for improved text handling.
  • New Auto data type for storing any type or object.
  • New Xojo.Core classes that make creating international applications easier.
  • SSLSockets now support newer security protocols like TLS v1.1 and v1.2, and now defaults to TLS v1 instead of SSLv3.
  • For Web applications, a new HandleURL event allows processing requests for URLs that previously could not be served. This feature also gives you the ability to respond to requests from Google and other search engines.


So as of now, we programmers, have two new development tools added to our repertoire: Xojo iOS and B4i (see previous article). Both with their advantages and drawbacks. As a Windows programmer it is nice for me to be able to develop iOS apps on my own platform with B4i. At the time of this writing, Xojo iOS is Mac only. But who knows, maybe there is some secret Santa out there that will put a Mac mini under my tree (hint!).

But this a personal view of course. My code lib for android (B4A) is also vast and the conversion for my mobile apps is probably going to go smoother when I stay in the same language and OS. So in the end, it’s up to you to make a choice (or use both)! After all, it’s almost Christmas, so you all deserve a treat…

Happy programming!

Alwaysbusy


Xojo: ABXPlay alpha 0.7

 

ABXPlay

DISCONTINUED and replaced by ABMXPlay in ABMaterial 2.0 for B4J. Interested parties in the source code for the Xojo version can contact me via email.

ORIGINAL ARTICLE:

It has been a while since my last post, but I’ve been busy. This is the first alpha release of ABXPlay! For now it is closed source as I want to keep control over changes and bugs, but it will probably be open source when the final version arrives.

ABXPlay is an advanced WebGL control for Xojo with a fall back to a HTML5 Canvas if the browser does not support WebGL.

Features:
Drawing of primitives (line, rectangles, circles, arcs, polygons, curves, …)
Sprites and Textures
Container objects that group primitives and other containers
Scaling, Alpha, Rotation, Position Tweening for all Containers
Drag/Drop of Containers
Multi user events
Audio support
Emitters
Spritesheets and Spines
Javascript injection
Filters and Shaders
Text (fonts, Google fonts and Bitmap fonts)
Basic DOM object support

Experimental
Basic Box2D support
Basic TMX support

Included is the help, all the examples shown in the Xojo forum posts with source code and of course the ABXPlay engine/control.

You can download alpha 0.7 here .
The help is included in the download, but can also be consulted here

For those who followed the adventures of our South Park friends, You’ll notice a final chapter. Although Chef solved the Kenny Ghost problem, it seems Eric still is suffering a bit. When he want’s to play some football (yes, I mean football, not soccer), one Kenny keeps giving him trouble!

This illustrates some basic Box2D support. (Physics engine, Collisions, Joints).

Box2D in ABXplay

Notes:

1. If you create a new project, make sure the control is locked on all sides of the window
2. Set the properties on the control in the inspector (like the view properties, if it should be interactive, the Scaletype, etc…)
3. Assets should be copied in the subfolder \Assets\ next to your project.
4. Make sure also the \Engines\ folder is next to your project!
5. To test another example, change the ‘DefaultWebPage’ to another one of the example WebPages.

But most of all, have fun with it!

Alwaysbusy

Click here to Donation if you like my work


Xojo: to fast with report on iOS update

doh
In my enthousiasm when I skimmed over Pauls blog post it seems I did some wishful thinking.
Sure hope one day it may come through though…

Paul Lefebvre:

Sorry for the confusion, but my blog post only shows 2048 for desktop and web. The iOS screenshot is from the original 2048 game. An iOS version of 2048 written in Xojo is something I’m working on but I don’t have anything to share just yet!

My apologies to my readers who were just like me already jumping around in anticipation. ‘But at the very least, you did some sport Alwaysbusy’, my doctor likes to add…

Alwaysbusy


Xojo: Update on iOS with a 2048 game clone (or so I thought)

Xojo on iPad

Xojo on iPad

NOTE: This was just a dream (R.E.M.) Seems it was only for Web and Desktop, NOT iOS. See update post

But for those who also want to dream, here is the original article:

The news on new iOS programming environments is coming out rapidly nowadays! Paul Lefebvre posted a real life game on his blog, written in Xojo this time. It’s a clone of a well known game called 2048 written in the upcoming new Xojo for iOS.

Although I would’ve liked to have it seen on the Apple Store like B4i a couple of days ago, it shows Xojo is also making good progress on their iOS version.

And for me, it shows something I really like: a canvas control! As you may have noticed if you are following this blog, it’s my favorite object. It’s the one control that rules them all! Having a canvas at your disposal makes it possible to create whatever you can imagine and that is a great plus Xojo!

So another exciting one I’m waiting to get my hands on. Let’s hope for a very nice (early) Christmas 2014!

Go to Pauls page and download the app on your iDevice to check it out.

Cheers,

Alwaysbusy


Xojo: Nintendo Game & Watch Mario Bros

Mario Bros in Xojo Box
Last weekend I found back my old Nintendo Game & Watch game Mario Bros under some dust. I remember having a good time with this old game console. So why not rebuild it in Xojo?

I found some graphics and sounds on the internet and started rebuilding the game. A couple of evenings later, here it is!

I’m not 100% sure the gameplay is exactly the same as on the real console as the original source code is not released by Nintendo, but I think I’m close. Check out the video:

Use the mouse to:
1. start the games (Game A, Game B).
2. run a demo play (Time)
3. navigate Mario and Luigi up/down

Use the keyboard keys to:
1. ESC to close the game
2. D to move Luigi Up, C to move Luigi down
3. Upkey to move Mario Up, DownKey to move Mario Down.

Note: if you have problems moving Luigi (make sure caps lock is ON), or change the code in the canGame canvas KeyDown event to:

 select case asc(key)
    case 30 ' keyUp
      MyGame.Mario.Up
    case 31 ' keydown
      MyGame.Mario.Down
    case 68, 100  'd, D
      MyGame.Luigi.Up
    case 67, 99 ' c, C
      MyGame.Luigi.Down
    end select

Thanks to Alwyn for pointing this out!

You can download the full source here.
And the binaries (Windows & OSX) here.

Bye for now,

Alwaysbusy

Click here to Donation if you like my work


%d bloggers like this: