Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by saru15 · Aug 03, 2015 at 11:29 AM · imagecrop

Splitting an image to puzzle pieces

I'm trying to develop a game like zigsaw puzzle. what I need is trying to give the player to select any image from the gallery and put it as a puzzle. e.g if I have a picture of 500X500 size in the gallary and if I put it as the puzzle picture. Then I need that picture to crop or split whatever the right word is to particular 9 custom shapes. Is it possible by programming or is there any resource available which will help me in finding the solution of this problem. alt text

As seen below this will be flat image before and i want to convert that flat image into the custom pieces of the given grid. the shape is not rectangle nor square. if cell is custom so Please let me know how can i achieve this. thanks

8.png (273.6 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by NeverHopeless · Aug 03, 2015 at 12:35 PM

You are possibly looking for Masking feature of UI component. You can interact with Show mask graphic check box to show/hide the mask or enable/disable mask script as well. For masking you need 9 custom shape image and use image for each.

Recommended video

EDIT:

Goto Hierarchy window and follow these steps:

  1. Right click -> UI -> Panel

  2. Inside Panel - right click -> UI -> Image (say Mask)

  3. Inside Panel - right click -> UI -> Image (say BG)

  4. Add Mask component on Mask GameObject

  5. Set Image Source of BG gameobject.

  6. Set Image Source of Mask GameObject

  7. Set Mask gameobject over any part of BG gameobject

  8. Make BG child of Mask.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image saru15 · Aug 03, 2015 at 12:39 PM 0
Share

Hi Thanks for your answer. But can you explain a little bit more how should I crop that image into the 12 different maskable image.

avatar image NeverHopeless · Aug 03, 2015 at 01:16 PM 0
Share

@saru15, look at the edits.

avatar image saru15 · Aug 03, 2015 at 01:44 PM 0
Share

Hi thanks I'll try it and let you know .

avatar image
0

Answer by 2Mtech ADMIN · Aug 03, 2015 at 01:41 PM

You have to split the image into the parts you want with a photo editor program, and have several images that fit. Create a UI button for each image and drag the image to the button. Make a script to make them fit when they are the correct combination.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

polygon crop an image 0 Answers

how to crop image using opencv 1 Answer

Crop face and made it texture for 3d model 0 Answers

jibjab (insert your own face) implementation in Unity 0 Answers

Crop UI image and convert it as Sprite 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges