![]() |
VOOZH | about |
dotnet add package Imp --version 0.0.2-alpha
NuGet\Install-Package Imp -Version 0.0.2-alpha
<PackageReference Include="Imp" Version="0.0.2-alpha" />
<PackageVersion Include="Imp" Version="0.0.2-alpha" />Directory.Packages.props
<PackageReference Include="Imp" />Project file
paket add Imp --version 0.0.2-alpha
#r "nuget: Imp, 0.0.2-alpha"
#:package Imp@0.0.2-alpha
#addin nuget:?package=Imp&version=0.0.2-alpha&prereleaseInstall as a Cake Addin
#tool nuget:?package=Imp&version=0.0.2-alpha&prereleaseInstall as a Cake Tool
Imp is a lightweight, sprite-based rendering framework for F#, supporting both OpenGL (desktop) and WebGL (web). Inspired by Elmish and React Native, it provides a declarative way to build high-performance 2D applications with a functional architecture.
๐น Why "Imp"? The name comes from an Imp, a small mischievous creatureโjust similar to a sprite! Imp is designed to be a fast and lightweight sprite renderer for building graphical applications.
๐ Try the demo: davidtme.github.io/imp
With Imp, you can quickly set up a WebGL scene:
module Client.SimpleWeb.App
// Import required modules for application setup and rendering
open Imp
open Imp.Setup
// Define the name of the texture to be used in the application
let texture = "f-sharp-logo"
// Initialize a data manager for handling web-based data operations
let dataManager = WebDataManager(baseUrl = ".")
// Register the texture name with the data manager
dataManager.AddTextureName(texture)
// Define a function to create the main view of the application
let sampleView () =
// The view function serves as the root container for the scene
view () {
// The sceneRenderer sets up the rendering environment, including the background color
sceneRenderer (backgroundColor = { R = 29; G = 41; B = 61 }) {
// The singleRenderer renders individual sprites one at a time
singleRenderer () {
// Define a sprite with its position, dimensions, and texture properties
sprite (
x = 50, // Horizontal position of the sprite
y = 50, // Vertical position of the sprite
z = 0, // Depth position of the sprite
width = 255, // Width of the sprite in pixels
height = 255, // Height of the sprite in pixels
texture = texture, // Name of the texture to apply to the sprite
textureX = 0, // X-coordinate of the texture region to use
textureY = 0, // Y-coordinate of the texture region to use
textureWidth = 255, // Width of the texture region to use
textureHeight = 255 // Height of the texture region to use
)
}
}
}
// Create a WebGL display for rendering the application
let display = WebGLDisplay(elementId = "App", width = 800, height = 600) // Specify the HTML element and display dimensions
// Attach the data manager, the root view, and an optional per-frame callback to the display
display.AttachView dataManager (sampleView ()) None
// Start the rendering loop for the display
display.Run()
Clone the repository and explore the sample applications to see Imp in action!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.2-alpha | 454 | 3/24/2025 |