GithubHelp home page GithubHelp logo

futile's Issues

FRepeatSprite / FSprite constructor bug w/ fix

Hey Matt, switched to your development branch and noticed a possible bug in FSprite that crashes FRepeatSprite

FRepeatSprite's constructor calls the empty base constructor in FSprite. This prevents _localVerticies from being allocated and causes UpdateLocalVertices in FRepeatSprite to crash.

I've fixed this in my fork by changing the constructor to this..
protected FSprite() : base() //for overriding{
_localVertices = new Vector2[4];
}

I'm not 100% how to put in a pull request for this fix from my fork, but wanted to give you the heads up.

Integrate physics with Futile

Integrate with the built-in Unity physics engine. Create a separate physics library/engine/thing to do this so that it doesn't overcomplicate the normal Futile stuff. It'll probably be stored as a separate github project.

Add support for trimmed and rotated atlas elements

It'll save significant texture space if we can use the trimmed and rotated atlas elements that TexturePacker can output.

For the most part it shouldn't be too tricky, but there might be some issues if the font atlas gets trimmed or rotated.

FButton does not properly use expansionAmount

expansionAmount was being applied in HandleSingleTouchMoved and
HandleSingleTouchEnded but not HandleSingleTouchBegin.

This change to HandleSingleTouchBegin in FButton.cs corrects the issue.

@@ -98,7 +98,11 @@ public class FButton : FContainer, FSingleTouchableInterface
{
Vector2 touchPos = _bg.GlobalToLocal(touch.position);

- if(_bg.textureRect.Contains(touchPos))

  •  //expand the hitrect so that it has more error room around the edges
    
  •  //this is what Apple does on iOS and it makes for better usability
    
  •  Rect expandedRect = _bg.textureRect.CloneWithExpansion(expansionAmount);
    
  •  if(expandedRect.Contains(touchPos))
      {
          _bg.element = _downElement;
    

FButton issue on Android with Unity 4

Here is the info I was given:


The problem is that the FButton will become untouchable after the app entered to the background and then goes back. I've recorded a small video about this. http://sound.bai-hua.org/temp/IMG_0107.mov

The banana project is running under Galaxy Nexus, and built with Unity 4. And it seems is an Android only issue, everything is alright on iPhone.

The solution I found is set shouldMouseEmulateTouch to true for all platforms. Just not sure if it's the proper way for this case.

UnityEngine.GameObject.active is obsolete: Unity 4

Just installed Unity 4. Everything seems to be working fine with Futile except for this warning:

Assets/Plugins/Futile/Core/FRenderLayer.cs(110,29): warning CS0618: UnityEngine.GameObject.active' is obsolete:GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'

Just thought I would give you a heads up!

Unity 4 code should use gameObject SetActive()

I mistakenly used gameObject.activeSelf as a setter instead of using gameObject.SetActive() in the new Unity 4 code in the FRenderLayer.

It should just be a simple matter of search and replace, not a big deal at all.

Let FButton hit rectangles be overriden

See this issue: #39

Basically it'd be really useful to allow the option of FButtons getting passed a custom rect to use as the hit area instead of always using the bitmap's texture rectangle.

Using extended/non-contiguous characters in GlyphBuilder results in IndexOutOfRange in FFont.cs

Here is the pertinent part of the GlyphBuilder output:

page id=0 file="Andika.png"
chars count=189
char id=210 x=2 y=2 width=34 height=49 xoffset=2 yoffset=0 xadvance=29 page=0 chnl=0 letter="Ò"
char id=211 x=38 y=2 width=34 height=49 xoffset=2 yoffset=0 xadvance=29 page=0 chnl=0 letter="Ó"
char id=212 x=74 y=2 width=34 height=49 xoffset=2 yoffset=0 xadvance=29 page=0 chnl=0 letter="Ô"

The problem appears to happen in FFont.cs, from the following lines:

lines 231 - 235:

else if(words[0] == "chars") //chars count=92
{
    int charCount = int.Parse(words[1].Split('=')[1]);
    _charInfos = new FCharInfo[charCount+1]; //gotta add 1 because the charCount seems to be off by 1
}

The above code should determine the maximum charID but instead uses a count. This is not valid if there are characters missing from the GlyphBuilder set.

line 333:

_charInfosByID[charInfo.charID] = charInfo;

In this case the charID of 210 is immediately larger than the character count, which causes OutOfRange. For this case I am able to just change line 191 to _charInfosByID = new FCharInfo[256]; and comment out the updating based on count.

Perhaps a better solution would be to use a HashMap or similar for _charInfosByID.

Decide whether FButton isEnabled should eat touches

In some scenarios, you'll want a disabled FButton to still "eat" touches so that they don't go through to other buttons. I should figure out a way to allow both possibilities, and have a sensible default.

Create a "wipeable" sprite

Create a sprite that allows itself to be wiped, somewhat like a rectangular masked. Ideally it'll be wipeable in all 4 cardinal directions (including multiple directions simultaneously).

Use Futile on a 3D surface

See if Futile can be used in 3D, or rendered onto a 3D surface as a texture... it might require doing raytests with touches and turning them back into touch events, or something like that.

Text is sometimes blurry

This is actually a really tricky problem to solve properly, but I've got some ideas for how to figure it out. It's especially important to get it working crisp on iOS at non-retina resolutions.

Create FRenderTriLayer

This will allow layers made out of tris instead of just quads (the normal FRenderLayer will be renamed to FRenderQuadLayer).

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.