Skip to content

A flutter widget to display dice faces from the boardgame Middara: Unintentional Malum

License

Notifications You must be signed in to change notification settings

swittman/middara_dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A scalable renderer for die faces from the boardgame Middara: Unintentional Malum.

Getting started

Add the following dependency and font to your pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  middara_dice:
    git:
      url: git:https://github.com/swittman/middara_dice.git
      ref: main
// ...

flutter:
  fonts:
    - family: Cinzel
      fonts:
        - asset: packages/middara_dice/fonts/Cinzel-Bold.ttf
    - family: MiddaraDice
      fonts:
        - asset: packages/middara_dice/fonts/MiddaraDice.ttf

Import the file with

import "package:middara_dice/middara_dice.dart";

Usage

  • DieFace defaults to blank black die. All fields are optional.
  • Change the die color with color and the icon/symbol color with inkColor.
  • Set the face's number with number. If a number is not set, the corner icons will be rendered larger.
  • Set icons positionally with iconTR (top right), iconBL (bottom left), etc. using the enum DieIcon.
  • If any icon is set to DieIcon.skull, number and corner symbols will be ignored, instead showing a large skull icon in the center of the face.
const DieFace(
    color: Colors.red,
    number: 8,
    iconTR: DieIcon.shield,
    iconBL: DieIcon.book,
    iconBR: DieIcon.book,
),

See the examples for more detail.

About

A flutter widget to display dice faces from the boardgame Middara: Unintentional Malum

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages