Skip to content

Extending Style attributes #286

@mlohbihler

Description

@mlohbihler

I'm sure i'm just doing something dumb, but i can't figure this out. For my purpose i ended up writing my own renderer, based loosely on the one in the testbed. I want to be able to allow fixtures and bodies to be able to declare addition renderering styles, but i can't figure out how to extend the Style interface. I'm no expert in typescript, but what i've been able to determine is that the follow should work:

In index.d.ts

import * as planck from 'planck'

export namespace planck {
  export interface Style {
    lineWidth?: number
  }
}

I've tried many variations on this, but no joy. This approach has worked with other libs, but planck seems different somehow. I would greatly appreciate any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions