• Content count

  • Joined

  • Last visited

1 Follower

About botmaster

  • Rank
    Advanced Member
  1. How to bind mouse click action on drawn line

    Make it listen to a separate listener then.
  2. Personally I don't work directly in javascript, I use typescript and requirejs. In dev mode I output all my ts classes/modules as unique files (easier to debug) and let requirejs load whatever needs to be loaded (talking about js here). In prod mode I output only one file (.js) which in typescript is convenient since it only picks the file that the app really needs and nothing more. Browsers are usually loading .js file sequentially so you don't gain anything by breaking a js file down into smaller chunk unless you have something like requirejs to do the job once the page is done loading. Now for assets (other than .js files) it's a different matter, don't think all loading is the same, js is one thing, assets are another. You shouldn't need to preload everything your app is gonna need. I have a html5 app with 400M of assets, none are preloaded, instead every view loads what it needs when they show on display and clean up when they are removed. It's a more dynamic approach, there's no wait time for user and we save on bandwidth since we only load what is needed. But just for the javascript part look into typescript and requirejs, this will already make your work a lot easier and the insertion in the page very easy.
  3. PIXI Loader handling failed loads

    I try as much as possible to identify the problem, if internet is down I don't want my app to work anymore and I rather display an error to the user and quit everything. I usually have a fall back system with assets primarily on a CDN and a local fallback or relative fallback, if both do fail then I assume there's no internet anymore and I prefer to stop the app completely.

    I modified my asset manager (originally for as3 projects) to work with typescript/PIXI and provide different resolution and coordinates for my assets, it's not a public app since not many people are interested in that kinda app but that's one easy way to manage those problems.
  5. How to bind mouse click action on drawn line

    best way to do tooltips: Make a tooltip manager plugged to the mouse move/position (bunch of ways to do it) then objects that should get tooltips need to implement an Itooltip protocol/interface with at minimum 2 methods: hasTooltip, getTooltip. The manager works that way: is there a IToolTip under the mouse? yes > is object.hasTooltip() true? yes > display tooltip using object.getTooltip(). Very simple, very efficient.
  6. Clone the PIXI Container

    That's where OOP help (I work with typescript but same can be done in javascript), just make your seat objects extends whatever they are (Sprite?, Container?) and add a clone method in there, in that clone method make it duplicate relevant properties and assets and return the result in a new object and you are done. Cloning is the simplest thing in any technology, binary cloning is harder but I don't think it's an option in javascript.
  7. Manually loading bitmap fonts and images

    You can load anything with AJAX, the pixi loader is here only for convenience, if it doesn't fit what you need for a case then load your assets yourself using AJAX, xml, json, pictures, webservices, rest, soap, ect .... No limit what you can load with AJAX. Either write the whole code yourself or use jQuery.
  8. PIXI.utils.isMobile not working

    That's way too loose as a way to check what device your app is running on.
  9. PIXI-sound warnings

    Bump, seriously anyone has any inputs on SoundAPI support in IE? Why is that framework claiming it supports IE9+ and their example don't seem to work in IE? If I could get SoundAPI support in IE from IE9 without fails I could get rid of my legacy flash for IE only.
  10. PIXI load and access JSON

    Loading assets doesn't have to be done with PIXI, PIXI offers it for convenience but you can load just about anything using AJAX yourself and it's really not hard at all, just watch out for security restrictions.
  11. Line how in ninja friut

    First: use only ONE graphic object, just clear it before you draw again. Second: don't draw on mouse move, draw with a ticker (move: get position/do the math, ticker: draw no matter what) Third: use mouse move to store mouse positions (array.push) as Point in an array (draw all points in that array inside your ticker), that's how you "remember" previous mouse positions Fourth: remove points in that array based on either mouse velocity or set value (like 20 point max) or both (array.unshit)
  12. Refresh efficiency of the shape

    That sounds like you are looking for a wrong solution to a wrong problem, sure sometimes you want to optimize things but sometimes all you need to do to get the best performance is the CORRECT approach. Seems like you have a bunch of static object and a few or one non static but because of your setup they all need refreshing even though only one does really need it or something close to that. The solution is not to optimize anything here, the solution is to not set your objects like that in the first place. object that don't need updating > in container that don't need updating, objects that need updating > in container that needs updating ... ect .... With any technology you will never be able EVER to optimize anything that has been badly thought of and badly put together in the first place, it seems this is where you need to start. Tell us why your setup is like this and tell us what's your goal in doing it like this and I bet we'll be able to help you set it up in a way that won't require any optimization.
  13. PIXI-sound warnings

    I'm surprised to see that framework claims to support IE9+ since IE still has no official support for WEbAudio and in my own testing I found versions of IE11 with full support, no support, partial support. So I was wondering how that framework does achieve such a support from IE9+ if only using WebAudio API. I tested the demos in a few different IE11 version and as I suspected none of them could run the demos. So what's up with that IE9+ support?
  14. Deployment issue ES6

    It's just a race condition, before the instance of your app gets created you need a code that makes sure PIXI is ready to go. I ran into that kind of problem bunch of times before until I had enough of it and wrote some code that would only create my main app instance until it's sure the PIXI global is there to work with. The magical thing about it is that it takes care of all race condition scenario possible in every single browser so that's a win win.
  15. sprite as a container

    That's an illogical approach, if you can trasnform the container but don't want to transform the children then those children shouldn't be in that container to start with or that container shouldn't be able to transform, one or the other. You need to rethink your approach or probably explain what you are trying to achieve so we can tell you how to do it.