I have built a web based light SVG editor with simple functionalities such as (resize, rotate, dragging, coloring) using HTML canvas and fabricJS. Now just by curiosity i want to create a mobile app to this web based platform. started searching for alternatives or something similar to fabricJS in flutter but i had no luck.
Also searched for many solutions and i have never found something to serve this need in flutter or Native Android nor Swift, But I know it's possible there is canva who made something with the same approach but i couldn't find a way to know there secret sauce.
So, my direct question is if there an html canvas like in flutter and even a canvas-svg (and svg-canvas) parser.
Flutter doesn’t have SVG support and will never officially support it due to its performance.
Your best bet is to use CustomPaint for rendering the vector, then use SVG.js with js interop when it comes time to export the SVG. Not a simple solution since you’re having to work around lack of official support, but for basic functionality it should be completely feasible.
If you’re wanting to support importing vectors, you might want to check out flutter_svg’s code to take a look at how they handle SVG. This library only supports rendering SVGs, not manipulating or exporting them, but it may have some helpful code to point you in the right direction.
Related
What would be the best way to do a 2D Avatar Creator without using an game engine (ie. Unity)?
The avatar images will be a basic body and placing different images for the different body parts - head, body, legs, arms, etc. Layer the different images on top of the base image.
Can this be achieved in a regular Android app without using any sort of a game engine? Are there any libraries like this already done?
For a 2D Avatar Creator, using a game engine for a job like that seems overkill (a library might be too much as well).
Coding it from scratch is much simpler than having to deal with a bunch of unnecessary tools that at the end of the day just take space. Also, it is much more efficient, as you only code the bits you need.
Because you want to make this app for android, I'd recommed doing so using the official Android SDK. It includes Eclipse (a very nice IDE as well as the most popular) so no need to worry on what else to download.
This SDK requires you to use Java (If you haven't learned this language yet then do so. It's probably the best and only language you'll need to know).
I'm trying my hand at making a platform game and have been thinking about what I would use to design levels.
I was thinking of using a tile palette that would contain the graphic tiles and their properties. And a similar palette that would contain sprites.
This way I could drag and drop tiles/sprites onto a grid and specify property values. This could all be saved to some kind of file that would be read by the game.
Without getting too into the details, is this a sound overall strategy? Is there anything major that I'm forgetting? Or perhaps there's a better method?
This is a rather open-ended question, but I don't think there is anything wrong with your approach. You might have to try a few things to find out what works for you.
When I make platform games I find it useful to be able to edit levels while I'm playing them, by adding in code to the game which allows me to select a graphic tile from a palette and paint it onto the screen. The behaviour is usually linked to the graphic for my games but you could paint behaviour as well. You then need code for your game to save levels as well as load them. Obviously, you would probably want to remove the editor before releasing the game.
I don't know how much experience you have with game dev, but if you're thinking about making a tile-based platform game then your best bet is leveraging existing libraries/tools to avoid "re-inventing the wheel". I highly suggest looking into open source libraries/tools because you can modify them to your liking. I've had some good experience with libgdx and AndEngine in which case both have TMX support which is a file format that can be used in conjunction with Tiled map editor. I personally like libgdx because it has javadoc and very actively developed, and also that it's a framework rather than engine which gives you more flexibility (although more coding in some aspects).
I would like to develop or use an existing platform that will allow me to view custom vector data and use it as a map on mobile phones such as Android/IPhone (Maybe even WP7).
I'm hoping that there's already a good infrastructure for what I need so I would not need to develop a whole infrastructure by myself.
In Conclusion -
Is there any existing platform that may answer my needs?
If not, how would you guys suggest I should begin? How should I save my vector data? How could I read it? Should I view it with a graphics engine like OpenGL? Is there any chance this solution could be cross-platform?
I know that it's possible since it was already done with apps like Waze. And it works the same on iOS and Android.
Thanks!
After much research I found a solution that fits most of my needs.
At the moment I decided to go on Android only so I'm using AndEngine (In the future I guess it would be pure OpenGL).
AndEngine can read .svg files and turn them into PNGs at runtime, and also has a built in support for ZoomCamera which allows me to pan and zoom the map very easily.
I'm converting the SVG to PNG because apparently mobile devices do not have a very good anti-aliasing support, and rendering curved paths can also be a problem.
A New Year's resolution for me is to learn both the HTML5 Canvas and the Android Canvas API. (I do a lot of Swing scientific graphics stuff and need to branch out) How similar are they in concept and execution? Are they similar enough that is makes sense to try to learn both together at the same time? Or are they really different and I should probably focus on one at a time to avoid confusion?
I've used Swing's Graphics, HTML5's Canvas and Android's Canvas extensively and they are very similar. If you know how to use one of them, you'll quickly learn how to use the other two. The concepts are pretty much the same. The biggest difference is how Android stores some of the graphics state (it uses a Paint object you pass to the draw functions instead of setting the state directly on the Canvas.)
I would advise you to focus on one of them first, just to make things a bit easier.
I can tell you this...
They are of course similar, the most obvious difference being that HTML5 Canvas is designed to be cross platform where as Android Canvas is highly specialized, proprietary even. But just to get down to it..
HTML5 Canvas is web/server based and uses web language javascript to draw on the canvas.
Android is javascript and relatively the same.
I've been working with HTML5 Canvas and its very flexible and powerful. Im enjoying the color rendering system, with my experience the color normalization across systems helps a lot (especially with color sensitive charts). I've been experimenting with text animations and particle effects lately and I think its great for small screen applications! The easy of physics also makes it a great choice for more advanced implementations. Good Cross compatibility for my app/web hybrid apps (SaaS/SaP/B2B solutions)
HTML5 is young so its not without its problems, but I think with a properly coded website & SaaS/SaP/B2B Application any desired result is achievable. But there is plenty of information on stack about issues with loading HTML5 Canvas on Android phones & etc.
I read somewhere else on stack that PhoneGap might be a solution for you.
Here is a great chart that could help you: Mobile Frameworks
Hope this helps you!
ladies and gentlemen!
Very often on my job I meet the following requirement from the client, when developing android applications: "make it look like and iPhone app".
Yes, I know, that the best way is to offer him canonical Android design with all these patterns like dashboard, using menu button etc... But sometimes this is not the case, as instead, I have to make it look and animate just the same. It's frustrating.
Can you guys, please advice me an android library (if there is one) with iOS-like UI elements? Many thanks in advance, I'm looking forward to hearing from you!
To expand on Martyn's comment, which I agree with.
Perhaps there is a great reason why a client would ask for this, but in many cases I bet they might benefit from being challenged on this requirement. If I was presented with this request, I would first ask "Why?". Perhaps they'd answer as follows:
we need a consistent experience across platforms, or
it will be more cost effective to design once and apply to each platform, or
it doesn't matter why, just do it!
Here are some responses for each:
each user will generally have one phone, and won't require the experience on Android to be identical to iPhone - they only care that it works and looks great on their phone. In fact, an Android user would prefer if you used the UI patterns that are more common to the platform, as opposed designing to match iOS. Likewise for an iPhone user.
we have found that having a designer create a set of creative for iOS allows us to pretty much use the creative as-is for Android. Even though Android might have Tabs on top, versus bottom, we are still able to take the backgrounds, button styles, fonts and color schemes from one platform to the next. There will be slight differences, but overall the brand and look should translate well. Here is an example of porting a single creative design across platforms: http://daleburgosdesign.com/
if they answer in this manner, you might want to consider passing on the job. Pixel perfect matching across platforms is tricky aside from the ideas offered in previous answers (OpenGL and the use of a WebView - via Macarse). If the client can't provide good reasoning for this tricky requirement, then it might be best to search for your next client.
Not a straight forward answer to your question, but I hope you find it helpful!
There is no iphone UI library for android that I know of. What you can do is, get the iphone GUI psd and redo it for 3 sizes of android (for the 3 size ranges) and use the elements of these psd's to theme your application.
I get these kind of similar requirements. Sometimes it wont be much about the looks but about the navigation flow of the application and how new views or activities are animated. From my experience, there is no easy way to do it. So I end up making a lot of adjustments and hacks to get the job done. And I over bill the client. :)
Btw you could also consider libraries such as Sencha Touch, it will look the same in all phones that use a webkit browser.
AFAIK there are no 'iOS-alike' widget libraries for Android.
Because of this, you could reasonably charge the client more for both development and support, thereby providing an incentive to stick with the standard Android UI design and principles.
There is no library to port iphone views to Android but if you are starting both applications from the scratch you have two possible approach to share views between both platforms.
First one is using WebViews and coding HTML, JS and CSS. This kind of app is called hybrid.
Second one is using openGL. You can do it directly or using a framework like cocos2d-x.
Depending on what you are willing to you should choose what to use.