Wednesday, July 27, 2016

CGTEXT CLASS

This is a Mac only REALbasic class that will give you the ability to draw text in a Rb Canvas with more control and functionality using the Core Graphics framework in OS X. The class is free, but is encrypted. The download includes a demo project.
The class allows you to set the following.

SSCGText

*Character Spacing (single). The default setting is 0.25.
*Dash (Boolean). The pen style on TextFillStroke Fonts can be drawn with a dashed styled. The default setting is False.
*Drawing Mode (String). This setting determines the style of the font drawn. Available settings are, Text Fill, Text Stroke, Text Fill Stroke. The default setting is Text Fill.
*Fill Alpha (single). The color of the fill can be assigned an alpha value. The default setting is 1.0.
*Fill Color (color). The color of the fill can be assigned a color. The default setting is black.
*Font Name (string). You can assign the PostScript name of the font family. he default setting is “Verdana”.
*Font Size (single). You can assign the size of the font to be drawn. The default setting is 11.0.
*Pen Alpha (single). The pen alpha value can be assigned a value. The default setting is 1.0.
*Pen Color (color). The color of the pen can be assigned a color. The default setting is black.
*Pen Width (single). The pen width can be assigned a value. The default setting is 0.50.
*Rotate (single). The entire CGText object can be rotated. Positive values rotate clockwise. The default setting is 0.0.
*ScaleX (single). The entire CGText object can be scaled in the X direction. The default setting is 1.0.
*ScaleY (single). The entire CGText object can be scaled in the Y direction. The default setting is 1.0.
*Shadow (Boolean). The entire CGText object can given a shadow object. The default settings is False. When set to true the values for the shadow are, offset width 3.0, offset height -3.0 and blur value of 1.0.
*Should Alias (Boolean). The CGText object can be drawn without anti alias, i.e. jaggies. The default settings is False.
*Text (String). This is the text that the CGText object will draw. The default settings is empty (“”).
*Draw (Method). This is the method you call to show your CGText object. This Method should be called in the Paint Event of its associated Canvas.
*Constructor (Canvas). The CGText object is created by passing it the Rb Canvas you want it to be drawn in.

Original article (http://mauitom.maui.net/Real_Studio_Projects/CGText_Class.html

IPHONE LIKE OPENGL

This is an OpenGL project that ports the Xcode projects from Jeff LaMarche. Jeff has a fantastic series of tutorials about learning OpenGL on the iPhone. Please see the URL listed in the project file. You can now follow along on your desktop using REALbasic, using this project as a guide on how to adapt the code Jeff posts. The iPhone because of it limited memory uses a subset of the full OpenGL functions on the desktop. The iPhone uses a more modern approach to funneling the geometry via array pointers, MemoryBlocks in REALbasic. The original method of learning OpenGL using your drawing calls between the GLBegin and GLEnd calls is soon to be deprecated, so learning arrays is the way to go if you want to stay current with the OpenGL renderer.
I wrote this on my Mac and have not run it on a PC. The methods used to pack everything in to MemoryBlocks is done crudely. It should give you some idea’s on how to optimize with classes to get things done in a object oriented manner. The download has 13 different projects through Lesson 4.
Original article (http://mauitom.maui.net/Real_Studio_Projects/iPhone_Like_OpenGL.html)
Copyright © Xojo.pro | Created by Rbcafe