hxScout

hxScout aims to be a free, cross-platform alternative to Adobe Scout. When ready, the tool should provide much the same capability of its commercial counterpart, as the ability to display telemetry, debug, and memory usage data from a Flash Player runtime. The idea is to have the Haxe server read the Scout telemetry data stream, store stateful data, and deliver that data to some GUI.

The project is in pre-alpha at the moment. There is a socket server and AMF reader proof of concept. It currently only tracks frame durations, and doesn’t do it quite correctly, but it’s on the right track. The current GUI is familiar to Adobe Scount and is able to display allocations to see the garbage collector at work.

Sample

Server.hx:17: {name => callstack, delta => 236, span => 165}
Server.hx:17: {name => .sampler.medianInterval, delta => 1}
Server.hx:17: {name => .sampler.averageInterval, delta => 28, span => 21}
Server.hx:17: {name => .sampler.maxInterval, value => 0}
Server.hx:17: {name => .3d.resource.drawCalls, value => 1}
Server.hx:17: {name => [object Function], delta => 3817, span => 3791, value => .player.cpu}
Server.hx:17: {name => .tlm.doplay, delta => 7, span => 3810}
Server.hx:17: {name =>  - seed=1506269906, delta => 22, span => 10}
Server.hx:17: {name => [object BitmapData], delta => 576, span => 539}
Server.hx:17: {name => .swftags, delta => 5, span => 561, value => {name => null, modified => false, ymin => 0, ymax => 768, xmin => 0, xmax => 1024, symbolname => null}}
Server.hx:17: {name => .rend.display.mode, delta => 715, span => 1}
Server.hx:17: {name => fullscreen, delta => 20, span => 5189}
Server.hx:17: {name => .memory.newObject, value => {stackid => 0, size => 40, type => [object AVM1Movie$], time => 705633, id => 216931352}}
Server.hx:17: {name => .memory.newObject, value => {stackid => 412, size => 56, type => [class String], time => 705743, id => 293804592}}
MIT
Comments Off on hxScout

AmidosEngine

AmidosEngine is a FlashPunk inspired game engine base on Starling. It was created as a set of helping classes designed for fast development of games, something FlashPunk user are used to. The engine has a growing list of features, including world/entity structure, display classes as Spritemap, Tilemap, TileImage and Background, and sound classes, e.g Sfx.

It also has data and UI classes, e.g. ButtonEntity, as well as a 2D box collision system. It’s also possible to use cameras, but only move-based ones, no rotation or zooming. Finally it has a set of I/O events as multitouch and keyboard.

Sample

public class Main extends Sprite 
{
	public static const FRAMERATE:int = 30;
	public static const GAME_SCALE:Number = 2;
	private var mStarling:Starling;
	private var currentLoadingScreen:Bitmap;
	
	public function Main():void  {
		// entry point
		AE.Initialize();
		
		Starling.multitouchEnabled = true;
		Starling.handleLostContext = true;
		
		mStarling = new Starling(Game, stage, new Rectangle(0, 0, screenWidth, screenHeight));
		mStarling.addEventListener(starling.events.Event.ROOT_CREATED, gameStarted);
		mStarling.start();
	}
	
	private function gameStarted(e:starling.events.Event):void {
		mStarling.removeEventListener(starling.events.Event.ROOT_CREATED, gameStarted);

		AE.game.background.color = 0xFFCCCCCC;
		
		AE.assetManager.enqueue(EmbeddedGraphics);
		AE.assetManager.enqueue(EmbeddedSounds);
		AE.assetManager.enqueue(EmbeddedData);
		AE.assetManager.loadQueue(loadingFunction);
	}
	
	private function loadingFunction(ratio:Number):void {
		if (ratio == 1) {
			AE.game.ActiveWorld = new LoadingWorld(new DemoWorld() ,currentLoadingScreen);
		}
	}
}

Via: FlashDaily.net

9 Comments

AIR OpenCV Extension

AIR-OpenCV-Extension is a native extension that exposes HAAR cascade executions with OpenCV. It’s implemented as an asynchronous library and uses a separate thread for the OpenCV execution. This way the application doesn’t lock up during the image processing.

In order to use the extension, a developer has to create an instance of the extension, add a detection listener and load a haar cascade xml file. After the initial configuration, image data (bitmap) can be sent to the extension through the updateImage method. It’s also possible to set minimum and maximum sizes for the detection area’s, so an area smaller than the minimum size or larger than the maximum size are ignored. It’s recommend to supply a minimum size for the detection, e.g. a face must be at least 40×40 pixels, as this will improve the application performance.

Sample

// initial configuration
openCV = new OpenCV();
openCV.addEventListener(DetectionEvent.DETECTION_UPDATE, detectionUpdateHandler);
openCV.loadCascade("/Users/wouter/haarcascades/haarcascade_frontalface_alt2.xml");

// Read image data and upload it to the extension
bmpData.draw(video);
openCV.updateImage(bmpData, minSize, maxSize);

// In the event handler, you’ll get the detected area’s
// with the event object that is provided:

protected function detectionUpdateHandler(event:DetectionEvent):void {
  for each(var r:Rectangle in event.rectangles) {
    //draw rectangles here
  }
}
BSD
Comments Off on AIR OpenCV Extension

Pedometer

Pedometer is a native extension for iOS to fetch pedestrian-related data. The extension requires a device able to collect and provide pedestrian data, which is available in the iPhone 5s and up. Using the extension a developer can query pedometer data between a start and end-date, as well as use events to monitor any data change: a basic event is fired when pedometer data is available within the specified range. The event has the total number of steps, the total distance in meters and the number of floors ascended and descended.

It is also possible to start and stop the pedometer with live updates about the number of steps, the distance and the number of floors ascended and descended. The extension comes with an example showing all the functionalities and future updates are free of charge.

Sample

public function PedometerExample() {
	var _pd:pedometerane = new pedometerane()
	_pd.addEventListener(StatusEvent.STATUS, onStatusEvent);
	
	_pd.getdata("01/01/1900 00:00:00", dateToMMDDYYYY(new Date()));
	_pd.startpedometer();
}

private function onStatusEvent(event:StatusEvent):void {
	trace(event);
	
	if(event.level == 'pedometerstartdate') {
		trace('Pedometer start date for query: ' + event.code);
	}
	if(event.level == 'pedometerstopdate') {
		trace('Pedometer stop date for query: ' + event.code+'\n');
	}
	if(event.level == 'pedometersteps') {
		trace('Total number of steps between dates: '+event.code+'\n');
	}
	else if(event.level == 'pedometerdistance'){
		trace('Total distance between dates: '+event.code+' m'+'\n');
	}
	else if(event.level == 'pedometerstepslive'){
		_livesteps = _livesteps + int(event.code);
		trace('Livesteps: '+_livesteps);
	}
}
Commercial
Comments Off on Pedometer

NativeMaps

NativeMaps is a native extension to use the native maps system on iOS. A significant part of the code is based on AIR Maps ANE, another native extension to handle maps. This new implementation has the ability to use the simulator, which improves the workflow. It is now also possible to test if the extension is supported by calling Map.isSupported().

Other changes include the user tracking mode able to be enabled/disabled, user location can be obtained from map, markers may have a details button (enabled via marker.showInfoWindowButton() and the MapMouseEvent.INFO_BUTTON_CLICKED event in the map instance). There are two new events for user location: MapLocationEvent.USER_LOCATION_FAILED and MapLocationEvent.USER_LOCATION_UPDATED.

MIT
Comments Off on NativeMaps

Touch ID

Touch ID is a native extension to use Apple’s Touch ID technology. Using Touch ID the device owner can can use a fingerprint as a passcode. With just a touch of the Home button the Touch ID sensor reads a fingerprint and identifies the owner. Since iOS 8 it is possible to use the Touch ID authorization in iOS applications

Using the Touch ID extension, the touch functionality can be extended into AIR mobile iOS projects. Among the extension  features are basic Touch ID verification and event handling, e.g. an event is launched when the checkid() method is requested.

Sample

package
{
  import com.caffaware.extensions.touchidane.touchidane;
	
  import flash.display.Sprite;
  import flash.display.StageAlign;
  import flash.display.StageScaleMode;
  import flash.events.MouseEvent;
  import flash.events.StatusEvent;
	
  public class TouchIDExample extends Sprite {
    private var _ti:touchidane;
    public function TouchIDExample() {
      super();
      stage.align = StageAlign.TOP_LEFT;
      stage.scaleMode = StageScaleMode.NO_SCALE;
			
      _ti = new touchidane();
      _ti.addEventListener(StatusEvent.STATUS, onStatusEvent);
      stage.addEventListener(MouseEvent.CLICK, clickStage);
    }

    private function onStatusEvent(event:StatusEvent):void {
      trace(event.code);
      trace(event.level);
      //1: Authentication success - if fingerprint is scanned correctly
      //2: Authentication failed - if fingerprint is not scanned correctly or wrong fingerprint
      //3: Cancel button pressed
      //4: Enter password pressed - your app should have an alternative method of authentication
      //5: Touch ID not configured 
      //6: Touch ID not supported - on older devices
    }
    private function clickStage(event:MouseEvent):void {
      _ti.checkid("Fingerprint Authentication");
    }
  }
}
Commercial
Comments Off on Touch ID

Video

Video-ANE is a native extension to play videos on top of everything. Usually when a developer needs to play a video within an application, there are some problems or limitations that need to be addressed. Displaying video in an AIR mobile project, for instance, using Starling is complicated because the Flash display list Video object is not efficient. The StageVideo class, which is the natural solution to overcome the efficiency problem, does not support third-party content placed on top of it, such as a Starling instance. There is also the limitation of a single video playing at any time.

The VideoTexture class, which should solve all those problems, is still not available on mobile. The goal of this ANE is to display a video on top of everything, helping developers to overcome all mentioned problems. The ANE can be seen as a reverse StageVideo class.

Sample

var _video:NativeVideo;
var _bounds:Rectangle = new Rectangle(0, 0, 480 / 2, 214);

_video = new NativeVideo(stage);
_video.addVideo("videos/trailer", "mov", _bounds.x, _bounds.y, _bounds.width, _bounds.height);
_video.addVideo("videos/sample_iPod", "m4v", _bounds.x, 150, _bounds.width, _bounds.height);
7 Comments

Rating

Rating is a native extension to handle the process of rating an application. It has a set of methods that can be combined to allow developers to collect and interpret some information before asking the user to rate the application, which might increase the chances of a positive rate. Regarding the available information, the extension provides a method to read how many times the application has been launched, how many uses per week and if the current version has been rated by the user, for instance.

Regarding the rating process, the extension has a method to directly open the rating screen of the corresponding app store. Additionally it’s possible to define a period of time or a certain amount of launches to trigger the rating screen, among other options.

Sample

// Call this when application launched
Rating.instance.applicationLaunched();

// Two examples of rating use
Rating.promptIfNetworkAvailable();
Rating.openRatingsPage();

trace("Launches: " + Rating.usesCount);

// Customize rating message
Rating.messageTitle = "Rate my app!";
Rating.message = "You like it, I know you do!";

// Schedule prompt to trigger in 3 days and a half
Rating.daysUntilPrompt = 3.5;
// If the user don't rate the app, remind him
// after 7 days.
Rating.remindPeriod = 7;
BSD
Comments Off on Rating

NESbox

NESbox is an emulator of NES, Super Nintendo, Sega Mega Drive video consoles, built on Adobe Flash technology. Currently it can only be run in your browser, but it supports a range of ROM types as .nes, .smc, .gen, .gb, .gbc and .gba files. The emulator has a set of built-in modes that enable, for instance, a single player or a network session.

The emulator renders all its graphics to container object that can be added to the state and manipulated by developers. It’s useful to insert the emulator into an already existing application.

Sample

var gameData:GameData;
var emulator:DisplayObject;

gameData = new GameData(this, stage.loaderInfo.loaderURL);
gameData.loadParams(stage.loaderInfo.parameters);
gameData.loadLocale();

emulator = new Single(gameData);
addChild(emulator);
MIT
Comments Off on NESbox

AmazonGameCircle

AmazonGameCircle is a native extension to use the services of Amazon Game Circle. According to Amazon description, the service should provide the tools to implement achievements, leaderboards, and saved game syncing across multiple devices. Once an app integrates with GameCircle, customers can seamlessly play games and interact with other gamers across mobile devices. The extension has methods to request and update leaderboards/achievements, as well as the ability to show the game circle screen or a sing in page.

When the extension is initialized, developers can use a set of events to monitor when the service becomes ready. It’s also possible to monitor other actions, such as score submission.

Sample

AmazonGameCircle.getInstance().addEventListener(AmazonGameCircleEvent.SERVICE_READY, handleAmazonGameCircleEvent);
AmazonGameCircle.getInstance().addEventListener(AmazonGameCircleEvent.SERVICE_NOT_READY, handleAmazonGameCircleEvent);
AmazonGameCircle.initialize();

private function handleAmazonGameCircleEvent(e:AmazonGameCircleEvent):void {
  switch (e.type){
      case AmazonGameCircleEvent.SERVICE_READY:
          // Game circle ready           
          break;
      case AmazonGameCircleEvent.SERVICE_NOT_READY:
          // Game circle not ready
          break;
  }
}

AmazonGameCircle.submitScore(leaderboard_id, value);
AmazonGameCircle.showLeaderboard(leaderboard_id);
AmazonGameCircle.updateAchievement(achievementId,progress);
AmazonGameCircle.showAchievements();
BSD
Comments Off on AmazonGameCircle

Making Flixel Community GPU accelerated

Flixel was developed in a time when Flash capabilities were solely based on CPU. In order to display all those sprites and effects on the screen, developers had to manipulate bitmaps, copying pixels from one place to another. Usually the pixels from each game asset are copied to a bitmap representing the screen, pretty much like a drawing buffer. That process is known as blitting.

Even thought Flash is really fast at copying pixels around, blitting has lost its meaning when game engines started to use the GPU to draw assets on the screen. A GPU is power friendly, which makes it a better fit for mobile development, not mentioning that it is way faster than the CPU to draw things.

Lately we have been hard at work to bring Flixel Community to the GPU world, leaving the good old days of blitting behind. The current implementation, tracked under issue #90 on Github, is more of a prototype than a final version, since no big optimizations were performed yet. Despite of that, the results are outstanding so far.

Below is a chart showing the Bunnymark benchmark running the latest dev version of Flixel Community, using a blitting and a GPU render (powered by Genome2D): Bunnymark - Flixel Community v2.57-dev As demonstrated the blitting render was able to draw between 500 and 1000 sprites simultaneously before dropping the FPS rate. The GPU render, on the other hand, was able to draw up to 2500 sprites before dropping the 30 FPS mark. Using the amount of 2500 bunnies as a parameter, the GPU render performed 428% better than the blitting one. That is a huge performance gain!

Here’s an image of Bunnymark using the GPU render: flixe_community_gpu_bunnymark And here is the same benchmark using the blitting render: flixe_community_blitting_bunnymark The new GPU render is being developed to be a drop in replacement for the current blitting render. If everything goes as planned, developers will just recompile their projects using the upcoming Flixel Community version and the result should be GPU accelerated, no significant code modifications will be required regarding the drawing process.

Making Flixel Community GPU accelerated will be a huge boost for several developers. I hope you like this new feature as much as we do :)

blitting flixel flixel community GPU
Comments Off on Making Flixel Community GPU accelerated

MacOSFullScreen

MacOSFullScreen is a native extension to allow applications to use native full screen move in Mac OS (Lion or higher). It allows the application to have its own space created, so user can interact with it the way they already do with other applications in the system, using Mission Control, for instance.

The extension is based on a single method call. After invoking the method, the application becomes full screen.

Sample

var macOSFullScreen:MacOSFullScreenANE = new MacOSFullScreenANE(true);
macOSFullScreen.enableFullScreen();

Via: FlashDaily.net

Comments Off on MacOSFullScreen

ShareWithInstagram

ShareWithInstagram is a native extension to share images to Instagram on iOS. If an application creates photos and users should be able to share these photos using Instagram, the extension can be used to access the Document Interaction API to open the photo in Instagram’s sharing flow. The extension has two entry points, a property to check the installation of Instagram and a method to open the image with Instagram app for share (using a ByteArray and String caption).

The image must first be saved in PNG or JPEG (preferred) format and use the filename extension “.ig”. Alternatively it’s possible to show only Instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) by specifying the extension class igo, which is of type com.instagram.exclusivegram. When triggered, Instagram will immediately present the user with the filter screen. The image is preloaded and sized appropriately for Instagram. Other than using the appropriate image format, described above, the only requirement is that the image is at least 612px tall and/or wide. For best results, Instagram prefers opening a JPEG that is 612px by 612px square.

Sample

if(com.azer.ios.Share.getInstance().isInstagramInstalled()) {
    var byte:ByteArray = new ByteArray();
    byte = YourBitmapData.encode(YourBitmapData.rect, new JPEGEncoderOptions(90), byte);
    com.azer.ios.Share.getInstance().addEventListener(StatusEvent.STATUS, onStatusHandler);
    com.azer.ios.Share.getInstance().postToInstagram(byte, "Your Caption Here");
}

function onStatusHandler(event:StatusEvent):void{
    // you call here:
    // com.azer.ios.Share.getInstance().dispose();
}

Via: FlashDaily.net

MIT
Comments Off on ShareWithInstagram

AirMicrophone

AirMicrophone is a native extension that aims to replace the Microphone class on iOS. The API’s goal is to write the same code than if using flash’s Microphone class, except that the developer will include a different class. The microphone class in the ANE has some methods that will not work, they are there to ensure the compatibility with its Flash equivalent.

The extension is able to record sounds and supports activity level monitoring.

Sample

import cc.fovea.ane.AirMicrophone.Microphone;

// Initialize the microphone
var mic:Microphone = (Microphone)(Microphone.getMicrophone());

// All this is ignored when using the ANE. Just here for compatibility.
mic.setLoopBack();
mic.addEventListener(StatusEvent.STATUS, onMicStatus); 
[...]

// Start recording
mic.rate = 11; // (or any non-zero value)

// Retrieve activity level
trace(mic.activityLevel);

// Stop recording
mic.rate = 0;
Apache 2.0
Comments Off on AirMicrophone

AmazonAds

AmazonAds is a native extension that enables the use of Amazon Mobile Ads. The API is simple to use and understand, featuring two methods to display ads. The first one displays a banner using a unique string name to identify the ad. The string name used to display the ad can also be used to remove it in the future. The other method displays interstitials ads, which are not identified. A developer can display (or remove) only one interstitial at a time.

Sample

AmazonAds.setAppKey("AMAZON_APP_ID",false);
AmazonAds.showAdView('banner_name');
AmazonAds.removeAdView('banner_name');
AmazonAds.showInterstitial();
AmazonAds.removeInterstitial();

Via: FlashDaily.net

BSD
Comments Off on AmazonAds