!untrue

Members
  • Content Count

    7
  • Joined

  • Last visited

About !untrue

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  1. Thanks. I've been looking for this. This has been driving me insane for ages. I've previously resorted to patching pixi.js itself, but I hate doing that. What I find weird is how this isn't more of an issue for people.
  2. !untrue

    Text Scaling Setup

    It's a problem for me too. Curious to know how people are handling this in cases where you want sharp text. I'm thinking I could overlay html/css elements on top of the canvas? Or failing that, I might design everything around a set of fixed resolutions and forget trying to scale. But yeah, it's a lot of work just to make the fonts a bit nicer looking.
  3. !untrue

    Pixi game in iFrame not scrolling / swiping

    I've encountered this too. What I ended up doing is modifying pixi.js to not "prevent default" if the tap is also a drag (there are some "if" blocks to work with here). But I had to re-minify the dev version and it's not really ideal to be stuck doing that. The most simple way I've found without modifying pixi.js is to set this at the top of your code. PIXI.AUTO_PREVENT_DEFAULT = false;But it won't prevent touch-scrolls or pinch-zooms from pressing buttons if you touch that area to scroll. It might work for your purposes. Unless there's a way to prevent default on your buttons on an individual basis, which I haven't looked at yet.
  4. !untrue

    getting mouse hover event on a shape

    This may or may not be it, but have you tried accessing the contents of mouseData and pulling out hexId through the event target? That's how I'm doing it anyway. I think in the scope of that function, when it's called later, doesn't have any idea what shape.hexId is, and looks for it in the global scope and craps itself. Try something like this for both event handlers... shape.click = function(mouseData){console.log("MOUSE CLICK " + mouseData.target.hexId);}
  5. !untrue

    Need my canvas to pinch-zoom & pan

    So, knowing I want to preventDefault for some things and not others, I've narrowed it down to. Commented out... if(PIXI.AUTO_PREVENT_DEFAULT)event.preventDefault();...from PIXI.InteractionManager.prototype.onTouchStart And added... event.preventDefault();to PIXI.InteractionManager.prototype.onTouchEnd Though I'm not completely certain with my reasoning about the code, what I'm trying to do (and it appears to be working) is to preventDefault on touches that are taps, and not preventDefault on any other kind of touch. It's doing what I want it to do now, without the weird hover & selection side effects, but my question now is, how do I roll this back into the mini-fied pixi.js. Do I just run this modified dev version through a mini-fier? (And can anyone recommend a specific mini-fier to use?) Or is there some better practice way of patching/overwriting these functions from outside pixi.js Never mind, I RTFM and built it with node/grunt. /derp
  6. !untrue

    Need my canvas to pinch-zoom & pan

    Ok, I found this looking at the dev build... PIXI.AUTO_PREVENT_DEFAULTSetting it to false in my app has enabled pinch-zoom and pan touches, while still being able to click. Although it's now causing taps/clicks to leave a mouseOver on my buttons, as well as causing momentary selections of other page elements outside the canvas. Which I think a vanilla canvas does too. Hmm.
  7. !untrue

    Need my canvas to pinch-zoom & pan

    I have a Pixi.js game/app embedded in a html page, and everything is working fine. The only problem is that I can't use the canvas to zoom or pan the page... this is a problem when I'm testing it on a small iPhone screen, if I position the canvas such that it takes up the whole screen, then I can no longer pan back to the rest of the page because all I can touch is the canvas. I'd also like zoom functionality for a little better usability. At the moment I'm using .tap and .click at the same time, which apart from the zoom/pan problem, is working out fine. A vanilla JS canvas seems to respond well to pan & zoom touches, as well as successfully registering "clicks", so I'm hoping this isn't something impossible. I've tried googling this and reading all the docs, but I'm going nuts trying to figure this out. It's one of those "I don't know what I don't know" problems. I assume there's some event bubbling that isn't finding its way back to the containing page... but I don't really know what to do with that.