Coder Social home page Coder Social logo

How to Polygon about tileview HOT 9 CLOSED

yolapop avatar yolapop commented on August 25, 2024
How to Polygon

from tileview.

Comments (9)

moagrius avatar moagrius commented on August 25, 2024

A HotSpot can be any shape - Rect, polygon, anything. The "simple" signature takes a path and makes a polygon from it, but you can instantiate HotSpot directly, and use any Region methods to define it.

It extends android.graphics.Region: http://developer.android.com/reference/android/graphics/Region.html

Here's the wiki: https://github.com/moagrius/TileView/wiki/Hot-Spots

HTH.

from tileview.

yolapop avatar yolapop commented on August 25, 2024

all right sorry didn't read the hotspot wiki :)

from tileview.

moagrius avatar moagrius commented on August 25, 2024

no problem - good luck

from tileview.

yolapop avatar yolapop commented on August 25, 2024

Anyway.. if i have 4 points of rectangle, should i use rectangle itself or
just the points? Which is more efficient?

from tileview.

moagrius avatar moagrius commented on August 25, 2024

I'd probably just use a Rect in the constructor. Something like this might work:

Rect rect = new Rect(a,b,c,d);
HotSpot hotSpot = new HotSpot(rect);
tileView.addHotSpot(hotSpot);

from tileview.

felipe-silvestre-morais avatar felipe-silvestre-morais commented on August 25, 2024

@moagrius
Can you give me a example in how to create a HotSpot Polygon?
I tried to use a Region with Path, using the method setPath(Path path, Region clip)
But the second parameter (Region clip) has not worked.

from tileview.

moagrius avatar moagrius commented on August 25, 2024

https://github.com/moagrius/TileView/blob/master/tileview/src/main/java/com/qozix/tileview/TileView.java#L592

Note that HotSpots are Regions

from tileview.

felipe-silvestre-morais avatar felipe-silvestre-morais commented on August 25, 2024

Thank you very much @moagrius !

from tileview.

moagrius avatar moagrius commented on August 25, 2024

👍

from tileview.

Related Issues (20)

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.