Code Monkey home page Code Monkey logo

davinci's Introduction

Davinci

๐Ÿ–ผ A powerful, easy-to-use image downloading and caching library for Unity in Run-Time! ๐Ÿ˜Ž

Simple usage - Single line of code and ready to go!

Davinci.get().load(imageUrl).into(image).start();

๐Ÿ”ด Update : Support for any type of Renderer components has been added. now we can download 3D model's textures in run-time!

Features

Customizable image placeholders

Davinci.get()
    .load(url)
    .setLoadingPlaceholder(loadingTexture)
    .setErrorPlaceholder(errorTexture)
    .into(image)
    .start();

Loading Fade Time

Davinci.get()
    .load(url)
    .setFadeTime(2) // 0 for disable fading
    .into(image)
    .start();

Fully access to operation progress and callbacks

Davinci.get()
    .load(imageUrl)
    .into(image)//or rawimage
    .withStartAction(() =>
    {
        Debug.Log("Download has been started.");
    })
    .withDownloadProgressChangedAction((progress) =>
    {
        Debug.Log("Download progress: " + progress);
    })
    .withDownloadedAction(() =>
    {
        Debug.Log("Download has been completed.");
    })
    .withLoadedAction(() =>
    {
        Debug.Log("Image has been loaded.");
    })
    .withErrorAction((error) =>
    {
        Debug.Log("Got error : " + error);
    })
    .withEndAction(() =>
    {
        Debug.Log("Operation has been finished.");
    })
    .start();

Caching Control

You can simply cache downloaded images so Davinci won't download it again from the same url. It's cool! Isn't it? ๐Ÿ˜ (Default is True)

Davinci.get().load(imageUrl).setCached(true).into(image).start();

Also you can clear Davinci cached files:

//For a certain file
Davinci.CleareCache(imageUrl);

//For all files
Davinci.ClearAllCachedFiles();

Also:

  • Supports Unity UI Image/RawImage Component
  • Compatible with all platforms and unity versions.

Supporting Platforms

  • Standalone Builds
  • Android
  • iOS
  • WebGl

Usage

Clone the project. Open Davinci/Assets in unity or import the UnityPackage to your existing project.

You can see lots of examples in Assets/Examples

Please see the Wiki page for more information and examples

Development

Want to contribute? Great!

Make a change in your file and instantaneously see your updates!

TODO

  • Improvements
  • cache invalid time
  • update cache(LRU etc)

License

Davinci is available under the MIT license. See the LICENSE file for more info.

davinci's People

Contributors

shamsdev avatar techie-pi avatar imangolkar avatar khmaies5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.