User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: is it possible to dynamically slice objects like in fruit ninja?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question is it possible to dynamically slice objects like in fruit ninja?

    I want to create this game mechanic and have tried searching all over the place and I can't find anything good, isn't there a shader that can hide part of an object or something? so then you can just duplicate the object, hide the top and hide the bottom separately so it gives the illusion of slicing the object

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump

    cause i rly need some help on this lol

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    353
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    cut.mfa

    voici une des façons
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's cool but what i'm looking for is to be able to cut from any angle

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    353
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    avec un actif je ne pense pas que ce soit possible ou alors avec un code tres compliqué, peut etre avec objet surface mais tout depend de l'utilisation finale

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    353
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    il faut que tu expliques plus en detail (un seul actif a l'ecran? y a t il un fond ou juste une couleur d fond?)

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically imagine an object, I want to be able to cut it in half or diagonally like in fruit ninja, there will be a background, I can try the surface object but I cant do it diagonally then

  8. #8
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jan 2018
    Posts
    353
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    avec un actif tu peux le decouper suivant la methode que je t'ai montré avec eventuellement plusieurs angle prédéfini mais je pense que c'est tout ce qui est possible de faire

  9. #9
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)

    Join Date
    May 2015
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what I thought I should do, thanks though!

  10. #10
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Someone referred me this problem through Discord, and is doable when using some vector maths.

    The shader consists of a single dot product between position (offset by a given value) and the direction (normalised). Any pixels resulting with a negative value have their alpha value set to 0.

    To work with this shader:
    - you need an Offset (which is position from the top left of the displayed sprite),
    - you need to give an angle in X, Y form. If you already have angle in degrees, doing fAngleX = cos(angle), fAngleY = 0 - sin(angle) should do. This should be perpendicular to the actual cutting angle.





    Here is an example (from the two screenshots above), it includes two frames, the latter dealing with an issue if the cutting object is rotating: CutByAngle.zip

    If you'd want to get the other cut side, negate the cos(angle) and 0 - sin(angle) parts. You should be able to set the effect parameters once and have it work well. (Setting effect properties and cos/sin are really expensive!)
    If any terms here were confusing, googling them along with "vector maths" or "trigonometry" should help, hope this helps!
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Generic cutting effect style "Fruit Ninja"
    By tiagodias in forum Android Export Module 2.5
    Replies: 0
    Last Post: 29th July 2018, 09:56 PM
  2. Generic cutting effect style "Fruit Ninja"
    By tiagodias in forum Fusion 2.5
    Replies: 0
    Last Post: 29th July 2018, 09:55 PM
  3. Fruit ninja slash effect, so close!
    By lachmandoo in forum iOS Export Module 2.5
    Replies: 15
    Last Post: 21st July 2018, 02:55 PM
  4. Fruit Ninja Tutorial - easy to make
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 1
    Last Post: 12th May 2016, 12:07 PM
  5. Cutting effect like Fruit Ninja?
    By SergioAndre in forum Fusion 2.5
    Replies: 3
    Last Post: 14th February 2014, 01:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •