NaN:NaN
NaN:NaN
--:-- / --:--
Newgrounds Background Image Theme

bailanzui just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Newgrounds Wiki: Medal

  • Package: com.newgrounds
  • Class: Medal


The Medal class describes a medal for a game.


Methods

These are the methods of Medal.


attachIcon

public function attachIcon(parent:DisplayObjectContainer):Sprite

Attaches the icon to the display list.


toString

public function toString():String



unlock

public function unlock():void

Unlocks this medal. If the user is logged-in and playing on Newgrounds, then the medal will be unlocked on their Newgrounds account. Otherwise, the medal is unlocked locally on their computer. The API will fire a MEDAL_UNLOCKED event.


Properties

These are the properties of Medal.


difficulty

public var difficulty:String;

The difficulty of the medal.


icon

public var icon:BitmapData;

The medal icon.


id

public var id:uint;

The numeric ID of the medal. This ID is unqiue among all submissions.


name

public var name:String;

The name of the medal.


unlocked

public var unlocked:Boolean;

Specifies if this medal has been unlocked by the user.


value

public var value:uint;

The number of points that this medal is worth. Medals may be worth either 5, 10, 25, 50, or 100 points.


Constants

These are the constants of Medal.


DEFAULT_ICON

public static const DEFAULT_ICON:BitmapData;

The default medal icon. This icon is used when an icon fails to load.


DIFFICULTY_BRUTAL

public static const DIFFICULTY_BRUTAL:String = "Brutal";

"Brutal" medals are worth 100 points.


DIFFICULTY_CHALLENGING

public static const DIFFICULTY_CHALLENGING:String = "Challenging";

"Challenging" medals are worth 25 points.


DIFFICULTY_DIFFICULT

public static const DIFFICULTY_DIFFICULT:String = "Difficult";

"Difficult" medals are worth 50 points.


DIFFICULTY_EASY

public static const DIFFICULTY_EASY:String = "Easy";

Easy difficulty medals are worth 5 points.


DIFFICULTY_MODERATE

public static const DIFFICULTY_MODERATE:String = "Moderate";

"Moderate" medals are worth 10 points.


ICON_HEIGHT

public static const ICON_HEIGHT:uint = 50;

The height of a medal icon.


ICON_WIDTH

public static const ICON_WIDTH:uint = 50;

The width of a medal icon.


Events

These are the events dispatched by Medal.


medalUnlocked

APIEvent.medalUnlocked

Dispatched when a medal is unlocked.