How to integrate and Program Avatar customization in HTML(5)? - html

I am making a Game in HTML5. In one part of it, I want the users to be able to customize the avatar they get by default.
For sample, let me share a screenshot from Zombie Lane on Facebook (now this game may not be in HTML5 but that's not the point):
My question is as to how do I include the images in the HTML5 page and in which format?
Whenever a clothing is different shirt is selected, the change is applied immediately. Is it a whole new photo that we see, or is the photo changed somehow by programming? How is it done?
NOTE: I do not want to get into 2D/3D rendering or any complicated algorithms, what's the simplest way?

Related

Browser game - Clickable Areas to an Image

I am trying to make a clone of a popular browser game called Travian. There is a /farms page where the user has an overview of all it's farms (I assume for now that the position of each kind of farm is always the same). Each farm can be upgraded to another level (up to 20) and the current level will be displayed on the /farms page. If the current farm level is 0, then no number will be displayed.
The issue I have is on that same png picture there should be 20 different a links for each resource and this is going to be done when the user will click on any of the white circle. How can I achieve that?
Dare I say it. But possibly html image maps is a potential solution.
https://www.w3schools.com/html/html_images_imagemap.asp
The technique isn't widely used in modern development practices mind you, as they aren't good on mobile. Svg alternative might be worth looking at too.
http://thenewcode.com/696/Using-SVG-as-an-Alternative-To-Imagemaps

best method for interactive site map

I've been asked to make an interactive site map for a local development which has a few houses on it, so users can click on the relevant house within an aerial site layout, and see it's details listed, and whether or not it's sold.
Staff need to be able to mark houses as 'sold'.
It's been a while since I've done anything like this - in the past I would have used flash and had the sold status updated via actionscript and php, but things have moved on. What are some of the most popular methods now?
I've included an example below which is a lot larger scale than what I'm looking to do, but the same principle. I can't work out how they did it though, and I'd really like it to be vector so it can be zoomed into without losing quality, plus have the option to animate things like the popup bubbles etc if the tech allows.
Also, I'd probably be looking to include this in a Kirby CMS site, and hopefully have the updating done through that, but it's fairly flexible.
Thoughts appreciated!
https://www.redrow.co.uk/developments/the-sycamores-162433/interactive-site-map-4803v1

How to get a car spinning with AS3? A 360 degree view

first post on here so be gentle!
I am currently designing an ad banner for my college assignment, the main feature i have is a car spinning, like a full 360 degree view.
Now I have took all of the media I needed and photoshopped them to how they need to look I just need some diction of where to go next.
I did want it where you can click and drag anywhere on the screen and it pulls the car around to where you want it, but I don't even know where to start with that! (please help if you can)
So I thought I would instead have it as a sort of image gallery with a next and previous button to select the next frame you want. But I don't like the way it looks so I was wondering if there was a way with action script where I could click on a button(next/previous) and the car would spin until I un-click? Rather than me having to keep clicking to load the next frame.
Also if I could I wanted a left to right scroll bar what could control the images, do you know any way of doing that?
Many Thanks in advance for ANY help!
Jordan.
If you want a commercial solution:
Krpano -> very advanced, excellent support, highly recommended for panoramas, 2D object is a bit lacking tho. Examples of 2D object
Object2VR -> very easy to use, not that great support, lacking API.
I would go personally for krpano because it is simply a superior tool. Great for panos, tons of possibilities. If you want it easy, go for Object2VR.
Now if you want to program it, and you need to program it, there are many options how you can do it. First of all, you need to load all the images into your app. Even if you don't maintain them in memory (that would be prefered, tho), you should load them so they are cached and can be reloaded fast. Your rotation can be achieved by "re-loading" the next image, or if you keep them in memory by simply referencing the next index of the array/vector. You always keep a reference index and upon click you simple increase the index and load the image. You than swap the images. It is too broad to explain, you will simply have to begin and ask for advice with some specific code.

HTML5 advice on drawings and images (canvas, SVG)

I'm looking into creating a website that allows people to create their own designs for a certain product. This product can have straight lines, curves, squares, and various shapes. I would not only like these people to be able to free hand draw their own artwork, but also be able to drag and drop (or just click in an area) certain stock images onto the template. I started this project using HTML/Canvas, and have implemented the drawing of freehand/shapes/lines, but I've read a few places that say I should be using SVG for the images.
Reading that I should use SVG for images made me think that since I'm a novice on HTML and website design in general, that I should possibly be doing this differently. So I was wondering how some people would implement this. For a good concept, think of a web site that people can design their own T-Shirts. You just draw on a square canvas, circles/squares/lines/free hand, but can also stick stock photos on there. Thanks, and I'm not looking for code, just to know if I should be using a mix of HTML/SVG/Canvas, or something completely different that I don't know about.
to summarize....
svg, or canvas.......or both, or something else completely.
Okay this is how i imagine you want it to work:
Your customers select a tshirt size and style.
An embedded application within your website allows the users to draw
a nice design they want or import an image
A price is calculated based on the size of the tshirt and the size
of the print
Upon succesful payment, you receive on your backend an image of the
print, the order details and you feed that image into your T-shirt
printing thingy, you print it and you post it.
If this is right you should consider this: http://svg-edit.googlecode.com/svn/branches/2.6/editor/svg-editor.html
You will probably want to remove some unnecessary tools from it and fire it up with different configurations based on what kind of tshirt the customer selected. One example is the t-shirt size. If a customer selects a small t-shirt you fire up a smaller drawing size. The list goes on.
You need to have some good JS skills however to be able to play around with SVG-edit because it is massive but from what i feel it fits perfectly to your purposes.
If you want to see the differences between SVG and Canvas read this: http://dev.opera.com/articles/view/svg-or-canvas-choosing-between-the-two/. Its pretty straightforward.
Now why did i suggest using SVG-edit? I don't know if there is any other application implemented using canvas that has so many tools and works so nice as SVG-edit.
It has everything you need, including a '''SAVE as PNG'' function which will serve your purposes in case your t-shirt printer doesn't print SVG images.

Image manipulation in ActionScript 3.0 : realistically editing faces

I am a flash developer who has worked mostly on small ActionScript projects, in particular websites, but I am dipping my toes into image manipulation with AS3. I have a project I'm working on to develop an application which would allow a user to upload their own picture into a swf, and then, using a slider, they can alter the image to make themselves look thinner or fatter. The condition is that it should require minimal user input - so ideally the most I could expect from the user would be a couple of control points identifying certain areas of the face in response to prompts e.g. 'click on the centre of the chin' and when the user clicks, the position would be stored, but this would need to be used sparingly, if at all.
So far, I have been able to use the FileReference class to handle the upload, and I am experimenting with using the DisplacementMap filter to edit certain parts of the uploaded image, but I am having serious trouble implementing this in a manner that would allow realistic deformation of the facial features in the image uploaded.
Is there anything that exists that might run along the same lines and that provides an explanation/source code I could look at to get a better idea of how to go around doing this? Or if there are any other ideas on how to manipulate and distort the image that doesn't use the DisplacementMap Filter?
Any feedback and help is greatly appreciated. Thank you for your time.
see http://sakri.net/technology/flash/flex/convolution_filter/ConvolutionFilterExplorer.html
(source code available)