-
Notifications
You must be signed in to change notification settings - Fork 789
Add support for non-PNG assets #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice direction! We definitely need this customizable. I'll think about this API some more— I feel that it might be easier and more flexible for our users to just have the entire filename for the custom emoji customizable instead of just the extension. What do you think? |
I definitively agree, that would be much better. Personally, I think making class Emoji::Character
attr_accessor :image_filename
def image_filename
@image_filename || default_image_filename
end
private
def default_image_filename
if custom?
'%s.png' % name
else
'unicode/%s.png' % hex_inspect.sub(/-fe0f\b/, '')
end
end
end |
How about we just do that? Looks solid. |
56969c4
to
fa104ff
Compare
👍 I've updated the pull request. |
|
||
```ruby | ||
emoji = Emoji.create("music") do |char| | ||
char.image_filename = "my_emoji.png" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change that to subdirectory/my_emoji.gif
to demonstrate that you can both add directory paths as well as change the extension
fa104ff
to
ac3620c
Compare
All good points, I've amended the commit. |
Cool thanks! 👍 |
🎉 Thank you! |
This adds support for having custom emojis that aren't PNG files. In other words - you can now have animated GIFs.
Usage: