NFlib
Encyclopedia
NFlib or NightFox’s lib is a library
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 written in the C programming language, developed to facilitate programming for the Nintendo DS
Nintendo DS
The is a portable game console produced by Nintendo, first released on November 21, 2004. A distinctive feature of the system is the presence of two separate LCD screens, the lower of which is a touchscreen, encompassed within a clamshell design, similar to the Game Boy Advance SP...

. It is based upon devkitARM and libnds
Libnds
libnds, formerly NDSLIB, is a library created by Michael Noland and Jason Rogers and is maintained and updated by Dave Murphy . It is meant to be an open source alternative to Nintendo's commercial SDK for the Nintendo DS handheld game console. It allows programmers that do not have access to the...

. It contains functions that ease the use of backgrounds
Background artist
A background artist or sometimes called a background stylist or background painter is one who is involved in the process of animation who establishes the color, style, and mood of a scene drawn by an animation layout artist. The methods used can either be through traditional painting or by digital...

, sprites
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

, collision detection
Collision detection
Collision detection typically refers to the computational problem of detecting the intersection of two or more objects. While the topic is most often associated with its use in video games and other physical simulations, it also has applications in robotics...

, and more.

The basic features of the library are:
  • 256 colors Tiled Backgrounds - It is possible to load up to 32 backgrounds to RAM
    Ram
    -Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

     from files using the FAT
    Fat
    Fats consist of a wide group of compounds that are generally soluble in organic solvents and generally insoluble in water. Chemically, fats are triglycerides, triesters of glycerol and any of several fatty acids. Fats may be either solid or liquid at room temperature, depending on their structure...

     filesystem or the Nitro filesystem. The pixel size of backgrounds must be in multiples of 256. The background system also supports extended palettes and can have up to 16 palettes of 256 colors. The VRAM
    VRAM
    Video RAM, or VRAM, is a dual-ported variant of dynamic RAM , which was once commonly used to store the framebuffer in some graphics adapters....

     configuration allows the use of 96 Kilobytes for tiles and 32 Kilobytes for maps. The system also supports infinite maps, using the “bank swap” technique, maintaining the entire map on RAM
    Ram
    -Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

     and copying only the necessary portions to VRAM
    VRAM
    Video RAM, or VRAM, is a dual-ported variant of dynamic RAM , which was once commonly used to store the framebuffer in some graphics adapters....

    . The only limitation is the size of the Tileset, which may not exceed 96 Kilobytes for all of the layers. NFLib also contains functions for manipulating backgrounds: display/hide backgrounds, unload from RAM
    Ram
    -Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

    , change the map tiles by code, change the palette colors, extended palettes, and more.

  • 256 colors Sprites
    Sprite (computer graphics)
    In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

     - You can load up to 256 graphics and 64 palettes for sprites. The system allows creation/deletion of sprites and hiding, rotating, resizing and flipping them. You can place up to 128 sprites per screen. The system also supports animated sprites with unlimited amount of frames, the frames can also be stored in VRAM
    VRAM
    Video RAM, or VRAM, is a dual-ported variant of dynamic RAM , which was once commonly used to store the framebuffer in some graphics adapters....

    , or just the current one. The system also supports the modification of a sprite palette to create effects.

  • Text Engine - Based on the tiled backgrounds system, has support for fonts of 8×8 and 8×16 pixels. Fonts supports up to 256 colors (you can use colored fonts), definition of your own colors, choice of the orientation of the text (normal, rotated clockwise
    Clockwise
    Circular motion can occur in two possible directions. A clockwise motion is one that proceeds in the same direction as a clock's hands: from the top to the right, then down and then to the left, and back to the top...

    , rotated counterclockwise), scrolling, and more. You must load a font for each text layer (up to 4 per screen).

  • Sound - Basic support for loading RAW files
    RAW image format
    A camera raw image file contains minimally processed data from the image sensor of either a digital camera, image scanner, or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited with a bitmap graphics editor...

     from the FAT
    Fat
    Fats consist of a wide group of compounds that are generally soluble in organic solvents and generally insoluble in water. Chemically, fats are triglycerides, triesters of glycerol and any of several fatty acids. Fats may be either solid or liquid at room temperature, depending on their structure...

     filesystem or the Nitro filesystem. Use of Libnds engine for playback. You can load up to 32 sounds in RAM
    Ram
    -Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

    .

  • Collision Maps - Many games require the use of Collision Maps. NFlib supports Collision Maps, editable from code and can work with up to 32 maps at a time and stored in RAM
    Ram
    -Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

    .

  • 8-bit color
    8-bit color
    8-bit color graphics is a method of storing image information in a computer's memory or in an image file, such that each pixel is represented by one 8-bit byte. The maximum number of colors that can be displayed at any one time is 256....

     and 16-bit color backgrounds - You can use 8-bit color
    8-bit color
    8-bit color graphics is a method of storing image information in a computer's memory or in an image file, such that each pixel is represented by one 8-bit byte. The maximum number of colors that can be displayed at any one time is 256....

     or 16-bit color backgrounds and images if you need more color depth
    Color depth
    In computer graphics, color depth or bit depth is the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per pixel , particularly when specified along with the number of bits used...

     on the screen. It includes functions for loading and drawing these backgrounds on the screen. You can load up to 16 RAW images
    RAW image format
    A camera raw image file contains minimally processed data from the image sensor of either a digital camera, image scanner, or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited with a bitmap graphics editor...

     of 8-bit color
    8-bit color
    8-bit color graphics is a method of storing image information in a computer's memory or in an image file, such that each pixel is represented by one 8-bit byte. The maximum number of colors that can be displayed at any one time is 256....

     or 16-bit color. This system also has support writing to the Backbuffer.

  • Bitmaps - The library provides functions for loading and displays bitmap files. You can load 8, 16 or 24 bits bitmap files and display them on the screen (16-bit mode). The library also handles the loading of BMP files and conversion into 16-bit color depth.

  • 3D
    3D computer graphics
    3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...

     Sprites
    Sprite (computer graphics)
    In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

     - Unique features using the 3D
    Stereoscopy
    Stereoscopy refers to a technique for creating or enhancing the illusion of depth in an image by presenting two offset images separately to the left and right eye of the viewer. Both of these 2-D offset images are then combined in the brain to give the perception of 3-D depth...

     engine of the Nintendo DS
    Nintendo DS
    The is a portable game console produced by Nintendo, first released on November 21, 2004. A distinctive feature of the system is the presence of two separate LCD screens, the lower of which is a touchscreen, encompassed within a clamshell design, similar to the Game Boy Advance SP...

    , which can create up to 256 sprites
    Sprite (computer graphics)
    In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

     on a screen simultaneously with a maximum size of 1024×1024, with the possibility of rotation, scaling and up to 62 units of different transparency
    Transparency (graphic)
    Transparency is possible in a number of graphics file formats. The term transparency is used in various ways by different people, but at its simplest there is "full transparency" i.e. something that is completely invisible. Of course, only part of a graphic should be fully transparent, or there...

    .

  • Wi-fi
    Wi-Fi
    Wi-Fi or Wifi, is a mechanism for wirelessly connecting electronic devices. A device enabled with Wi-Fi, such as a personal computer, video game console, smartphone, or digital audio player, can connect to the Internet via a wireless network access point. An access point has a range of about 20...

     - Very basic support for wireless communication using a wireless
    Wireless
    Wireless telecommunications is the transfer of information between two or more points that are not physically connected. Distances can be short, such as a few meters for television remote control, or as far as thousands or even millions of kilometers for deep-space radio communications...

     access point. There is partial support for UDP
    User Datagram Protocol
    The User Datagram Protocol is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol network without requiring...

     and it is under development.

  • Examples - The library includes over 30 examples ready for compilation, who show almost all of the functionality it incorporates.

  • Documentation
    Software documentation
    Software documentation or source code documentation is written text that accompanies computer software. It either explains how it operates or how to use it, and may mean different things to people in different roles....

     - Complete documentation in PDF, with full description of all of the functions.

External Links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK