Lachee / raylib-goplus

A newer version of the Go bindings for Raylib
zlib License
74 stars 6 forks source link

Can you make a Raylib Image into a Go Image? #20

Open Nv7-GitHub opened 3 years ago

Nv7-GitHub commented 3 years ago

You can make a Go image into a Raylib image, but is there any way to go back?

Lachee commented 3 years ago

hmm, good question. In theory there should be a way to do it back. Ill add that as a feature request. The implementation of the go->image can be found here

https://github.com/Lachee/raylib-goplus/blob/7ca39b8afc71042c5944ff69b2753f72c9b253b1/raylib/image.go#L36-L49

in theory you just have to reverse it

Lachee commented 3 years ago

Good First Issue I have marked this as a good first issue as this would be a relatively simple contribution for beginners if anyone wants to do it before I do.

Just simply add a function that takes a *Image and returns a image.Image, generating the data structure in a similar fashion as above.