Sign in to follow this  
thefootballguy

What is the Best way to save Bitmap data to database for Phaser to use?

Recommended Posts

I am trying to save sprite data to a database and being able to change it later.  but I am having trouble figuring out how to implement this. (preferable redis)

db.hmset("graphics:dude", JSON.stringify(dudeData));

    var dudeData = [
        '.......3.....',
        '......333....',
        '....5343335..',
        '...332333333.',
        '..33333333333',
        '..37773337773',
        '..38587778583',
        '..38588888583',
        '..37888888873',
        '...333333333.',
        '.F....5556...',
        '3E34.6757.6..',
        '.E.55.666.5..',
        '......777.5..',
        '.....6..7....',
        '.....7..7....'
    ];

Then use something like JSON.parse() to get the data back?

 

Share this post


Link to post
Share on other sites

Well thanks for the help @VitaZheltyakov but I finally figured out using it just using nodejs-redis examples. However, I don't know how to access the data OUTSIDE of nodejs  main "app.js" file. If anyone can help, I will greatly appreciate it. http://stackoverflow.com/questions/37956668/how-to-access-string-data-from-redis-through-another-js-file-in-nodejs

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.