Skip to content

[Enhancement] Crafty.attr({}) function? #1205

@0xf0xx0

Description

@0xf0xx0

To be honest, using the .attr property(?) is sorta annoying to use. Why not have it a function? It only takes up to 4 integers, so I think using it as .attr(x, y, w, h) would be much easier to use. Example:

var player = Crafty.e('2D, Canvas, Color, Fourway, Collision')
    .attr(200, 200, 10, 10)
// Other properties...

And then calling any additional properties as:

.props({
currHealth: 100
maxHealth: 100
// Other custom properties...
})

Would this work, or no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions