RobLoach / node-raylib

Node.js bindings for Raylib
https://robloach.github.io/node-raylib/
Other
237 stars 20 forks source link

fix easing demo and move easings back out of module #132

Closed konsumer closed 2 years ago

konsumer commented 2 years ago

This pulls easings out of parent, and puts them in raylib/addons/easings, so they can be optionally imported. I updated index, moved easings.js and updated the demo (in other/)

Related: #130

konsumer commented 2 years ago

I think I need to do 1 other thing: add it to files, so it gets included with npm-publish.

konsumer commented 2 years ago

ok, should be ready-to-go

RobLoach commented 2 years ago

Thanks! But I think embeding it directly in the module is best, since they are C functions. The extras can be part of the main raylib object, as that makes porting from C a lot easier... I think this may be a better approach... https://github.com/RobLoach/node-raylib/pull/139

If you're looking to get a list of them, you can use...

const easingTypes = Object.keys(raylib)
  .filter(name => name.startsWith('Ease'))
  .map(function (name) {
    return { name: name, func: r[name] }
  })