Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 15.6 ('Green Screen Saver')
Instant purchase and download via GumRoad!

FEATURE

Green Screen Saver

Creating the Maxtrix movie effect in Xojo

Issue: 15.6 (November/December 2017)
Author: Eugene Dakin
Author Bio: Eugene works as a Senior Oilfield Technical Specialist. He has university degrees in the disciplines of Engineering, Chemistry, Biology, Business, and a Ph.D. in Chemical Engineering. He is the author of dozens of books on Xojo available on the xdevlibrary.com website.
Article Description: No description available.
Article Length (in bytes): 12,945
Starting Page Number: 21
Article Number: 15604
Resource File(s):

Download Icon project156004.zip Updated: 2017-11-01 11:55:24

Related Link(s): None

Excerpt of article text...

This is a program to display the Matrix Movie effect using Xojo 2017 R2.1. This works on Windows 10, Mac High Sierra, and Linux Ubuntu 16.04 which works in 32-bit and 64-bit modes. The program uses Xojo native code so that the same code-base can be used on the supported operating system. Press the small-case 'q' or the Escape key to quit the running program. Settings for the program can be changed by pressing the 's' key and available options are shown. Figure 1 is a screen grab of the running program.

The way this program works is that a window has a canvas, and the window is set to full-screen mode. Basic parameters are set to default settings, such as font size, length of characters, number of vertical lines, and so on. Each row begins with an array and the first character populates the array. The timer fires every 50 milliseconds and a new character is added to each of the lines in the array, and the updated lines are drawn on the screen. The timer loop continues until the user presses the Escape or letter q on the keyboard.

Options that can be changed at runtime are the number of vertical lines being drawn, the length of lines to be drawn, the rate at which the completed lines fade from the screen, and the range for the random size of characters that are drawn on the screen (see Figure 2).

Pressing the pushbutton Change will restart the screen saver instance with the new parameters. Pressing the Default pushbutton will set the starting runtime value ranges and then press the Change pushbutton to modify the settings and restart the instance. Clicking on the X or close window button will just close the window without making any changes to the current settings.

We start with the Open event in Window1 for some initial settings when the program starts. A new instance of the class ClsScreen is started and the parameters that can be changed during runtime are set to their default values. You can change these setting so that they always start with your preferred values every time the program starts.

...End of Excerpt. Please purchase the magazine to read the full article.