User supplied images

Okay, this one would be tricky - is there ANY way a user could include a photo of their own into the game?

In this case, I'm thinking of a game where I put a picture of everyone involved (all the NPCs) in the game. I'd like the user to be able to supply their own picture (say, 200x200 pixels) into the game. Could this be done by listing a specific local file? Would squiffy even recognize that?

To make matters worse, I wish this to be available for games loaded and run from the squiffy site.


K.V.

Is it true that 99% of today's spammers were born out of wedlock?


Another one bites the dust...


K.V.

Bluevoss,

You could probably let the player supply a link to a picture to use in-game. . .

I think you'd need server access to allow the player to actually upload a file, but I may be (and quite probably am) mistaken.


One way is to save it to imgur and add the link to the code. Let me find my example


Here what I did

<img src="http://i.imgur.com/rB3e4uK.jpg" alt="Civ" style="width: 100%;height: auto;"><br>
You wake up in Kavala, a vast beach community on the western coast of Altis.  The sun is out and you can hear small waves crashing in a rhythmic melody.  Seagulls fly overhead and pelicans skim the wave tops.  You smile. 'This place is beautiful' you think to yourself<br><br>
@set money = 1000
@set life = 1
<b>Money = {money}</b>

You would have to have them upload it, then send you a link, or you do it yourself. But works if your platform can link to the web


K.V.

This should allow the player to supply a link to an image during play:

Please supply a link to your image:

<input type="text" id="user-img">

[[SUBMIT IMAGE]]

[[SUBMIT IMAGE]]:
    squiffy.set("userImg", "<img src=\"" + jQuery("#user-img").val() + "\"/");

{userImg}

It works when I test it in the Squiffy ScratchPad in the documentation:

image


image


You'll probably want to clear the screen (or hide the input element) after the user submits the link, but I thought of that too late.


K.V.

This will hide everything without clearing the screen:

<span class="get-image-link">Please supply a link to your image:
</span>

<input type="text" id="user-img">

<span class="get-image-link">[[SUBMIT IMAGE]]</span>

[[SUBMIT IMAGE]]:
    squiffy.set("userImg", "<img src=\"" + jQuery("#user-img").val() + "\"/");
    jQuery(".get-image-link,#user-img").hide();

{userImg}

image


image


Log in to post a reply.

Support

Forums