Leaderboard


Popular Content

Showing content with the highest reputation since 03/17/19 in all areas

  1. 3 points
    No bans are happening here (yet). @5neia_opo2@google-mail.ooo, try to understand the frustration people are experiencing. A new user came to the forum and in nearly every post they made trashed the project they were asking about. A lot of people here put in a lot of time and effort to not only to develop the project, but answer questions here as well. I was definitely frustrated reading your responses as someone who has put 6+ years of their life into this project. @botmaster did a poor job of handling that situation, but has apologized and I'm sure will do better in the future, as will you as well. Let's all be adults about this, acknowledge we did something wrong, and move on. @5neia_opo2@google-mail.ooo you are free to ask any question you need help with, but I definitely recommend reading through some tutorials, the examples, and checking the API docs before asking questions. It will often lead to you finding the answer yourself, and there will be less fatigue for the people answering here on the forum. I'd also recommend you approach things you don't understand, or decisions you disagree with, with a more open mind. Try to learn and grow the new library, not all libraries are alike and different problem spaces call for different solutions. Having a bad attitude is a good way to earn ill-will in the community and you may no longer get the help you expect if you are ungracious about it. When you find inconsistencies, or things you think should work differently, then change it! Pixi.js is an open source library built by the community. Everyone gets a chance to make the library better by contributing to it. The best way to get problems you have fixed, are to fix them yourself.
  2. 3 points
    I had some similar problems with this yesterday so I wrote up the workflow I found to work step by step. Hope this helps anyone else who finds this thread in the future. https://www.adammarcwilliams.co.uk/creating-bitmap-text-pixi/
  3. 2 points
    TheBoneJarmer

    The future of web games

    Oh yeah, I remember reading that discussion. Well, to give my two cents. I think that discussion was pointless to begin with. I understand the question since there are not many popular hmtl5 games, but I would not call it dead, far from it. Web is a platform like PC, console and mobile. Most game devs use an engine like Unity3D or Unreal and export their game to platforms they can support. But games get exported more often to platforms where their game can run native because most games are too big to run smoothly in the browser. I mean, just look around and see how many devs actually created a 3D game in html5. Barely. And if someone did, is it probably low-poly. But that being said, that would be the only con I can think of. The biggest pro, and the reason I decided to go for HTML5 game dev, and not Unity or Unreal or any other engine, is because it is soooo damn easy compared to writing your game in C# or C++. I mean, all you need is a good IDE for web dev and your browser. And players don't even have to download your game. Heck, if you want to, you can put your game in a cordova container and export it to Android or iOS as if it is nothing. And just look at all the available resources. There are engines like Game Maker or Construct that allow you to export your game easily, as well as lots and lots of frameworks like Phaser, Pixi, MelonJS and so on. And also, since your game is actually a webpage, it can be integrated easily in many front-end technologies like Angular, ASP.Net, PHP and even NodeJS with Electron. That is also a very powerful benefit. Not to mention webhosting. I mean, a basic webhosting service is enough to host your game on since html5 games do not tend to be gigabytes big. Give it time. I admit I cannot think of a popular html5 game, but I am sure other forum members can fill me in on that one. I do see some gems once in a while. But those are often not only for web, but native too. They just have a web variant. You wont find yourself a whole RPG, but smaller games. But I like those, I am often very tired after work and to be able to play some small games while being half braindead is awesome, and very relaxing.
  4. 2 points
    I am making UI Components Framework for Phaser 3, that is driven by JSFL-generated jsons and atlases. It means that you can build your UI in Abode Animate, export it with given script, and forget about manual code positioning and building stuff! Please, try it out. https://xense.github.io/phaser-ui-comps-docs/tutorial-showcase.html Docs, examples, tutorials: https://xense.github.io/phaser-ui-comps-docs There are two basic things in this framework. First is ComponentClip, which is a view instance, it is recursively self-build by provided json and atlases. Second is UIComponentPrototype, which is clip controller. It can be easily extended to create any components, windows or whatever you need. Essential meaninig of it is that it doesn't need a clip to exist always. For example, you can change states of a root clip, and child clip can get new clip instances, ore lose them, and nothing bad happen. Some base components are already included UIButton has 4 states, "up", "over", "down", "disable" UIButtonSelect same as button, but behaves like checkbox, has 8 states, by adding "_select" suffix to UIButton's states when selected. UIButtonRadio Selectable buttons, that can be grouped to select only one of them. UIButtonDraggable same as UIButton, but also emits drag event, drag bounds can be self externally. UIScrollBar vertical or horisontal bar with draggable thumb and prev/next buttons. UIProgressBar Setup only start and end elements positions, scale, rotation or alpha, and this component will interpolate them according to provided progress value. UIScrollPanel Helper for scrolling any element with UIScrollBar. UIContainer Base container component to add other dynamically created components inside. Can be easily extended to create any types of lists, for example. I'm still working on new components and extending existing functionality. Tell me, would you use it, what else components you may need, and whatever you think about it. Any feedback is appreciated! Also I'll be thankful to any collaboration. Available at GitHub and npm
  5. 2 points
    b10b

    ctx.clearRect() not working with Image.

    @James432213 hi, many issues here, all solvable. 1) The function named "canvas" rename this and avoid some confusion, call it "init" or similar 2) doKeyDown function has parameter "e" but references "event" in the switch - be consistent. 3) the functions doKeyDown, updateCanvas, drawPlayer are scoped "above" the "init" function, so they can have no easy reference to the "canvas" variable defined within "init". Notice also the name collision of "canvas" if we ignore step 1. Easy fix is to move these function declarations inside the "init" function. 4) There's nothing wrong with ctx.clearRect Some basics in how to debug your code will be beneficial, in particular the developer console (F12) is great, and using "console.log" can send helpful messages there from your code. Use that as a start towards watching the flow of your code when it runs, and where things are not actually working as might be expected on a first draft of code. This will lead to more advanced debugging techniques and more elaborate (and working) code.
  6. 2 points
    Do you draw something else than the video to canvas? If something taints a canvas then it stays tainted no matter what is rendered in the future. Or it might be due to stream becoming unavailable at some point for short duration and that could cause tainting (though the bug report I found on this should be already resolved, it was 5 years ago). Pretty sure it's some kind of edge case in security constraints which causes canvas to become tainted (by something), which causes security error when pixels are read from it.
  7. 2 points
    -AAG-

    I hate designing levels!

    There! I said it! 😡
  8. 2 points
    mattstyles

    I hate designing levels!

    Procedural generation can be a load of fun, but its a butt-ton of work to get working well. You could even use a genetic algorithm (GA) to create levels, have an automated actor play them, test the 'success' of the actor using fitness functions and then loop that process until you get levels (again, based on a heuristic function) that are fun to play. The up-shoot is that you can, potentially, create a near infinite number of levels like this. Or at least generate a manageable amount (say, 30) and manually curate them. Depending on how good your heuristics are you can create levels that are harder or easier for humans to play. It's a ton of work though. So depends on your mindset. Some crazy people find that a wonderful coding challenge.
  9. 2 points
    there is no public property available but you could use the following private property timer._pause working example: var timer = game.Timer.add(1000, function() { sprite.remove(); }); if(timer._pause){ console.log("paused") } else{ console.log("Not paused") }
  10. 2 points
    @dataj, I am pretty sure you can find all the information in the documentation. Maybe you forgot to associate your game to your business? https://www.facebook.com/help/publisher/709041312624617/
  11. 2 points
    ivan.popelyshev

    Fading trail

    Here's the second one, super-v5 stuff: https://pixijs.io/examples/?v=v5.0.0-rc.2#/textures/gradient-resource.js Yes, you can use it as an alphamask. Why do you need though? Your trail is simple rectangle, right? In fact, that's one of common mask use-cases in Flash: alpha gradients. Its shame we cant replicate all that Flash stuff even after several years of coding.
  12. 2 points
    ivan.popelyshev

    Fading trail

    First demo will be here in 5 minutes or so : https://pixijs.io/examples/#/textures/gradient-basic.js It took me only one cup of soothing tea.
  13. 2 points
    jonforum

    Fading trail

    What about create you gradient in other canvas. https://www.w3schools.com/graphics/canvas_gradients.asp var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); // Create gradient var grd = ctx.createLinearGradient(0, 0, 200, 0); grd.addColorStop(0, "red"); grd.addColorStop(1, "white"); // Fill with gradient ctx.fillStyle = grd; ctx.fillRect(10, 10, 150, 80); and than, create `generate` a texture from this canvas context ? Am sure it can work ... but at the expense of performance. I do not remember which one, but there is a rpgmaker plugin that used this process with pixijs.
  14. 2 points
    I've got a situation my physics simulation is running at high framerate (60fps), but some devices my app runs on cannot run the graphics (PIXI) at 60fps without causing the physics simulation to stutter and jump, causing undesired artifacts. So, in pursuit of performance, I shoved the physics simulator (in my case, matter.js) into a web worker, but then still found that some devices couldn't handle updates at 60fps in the main thread. So I started setting an interval to apply updates from the simulation to PIXI at a fixed rate - 30 fps to start. However, sometimes even on some devices that was unsustainable. So, the question came down to - what FPS *should* my app run at? And when I say "run", I'm talking about changing the position of PIXI objects base on updates from the physics simulation, not about changing the speed of the PIXI's ticker. Since the speed at which I could apply updates from the physics simulation and still achieve sustainable render speeds without lagging varied from device to device, I decided the best way to decide on the FPS to run at would be ... let the app itself decide at run time. So instead of coding a fixed FPS, or giving the user a slider to adjust, I let my app measure and adjust it's FPS based on what it measures as sustainable while it's running. Enter my solution for my app, FpsAutoTuner: https://gist.github.com/josiahbryan/c4716f7c9f051d7c084b1536bc8240a0 - contributed here to the community in case it may help someone else solve a similar problem. It's framework-agnostic, no external dependencies, written as an ES6 class, but could easily be rewritten as a ES5 if you wanted. FpsAutoTuner works by measuring the FPS (which you tell it by calling `countFrame()`) and then every so often (at `tuningInteval`ms), it compares that measured FPS to the `fpsTarget`. When the measured FPS goes below `fpsTarget` less `tuningMargin`, the `fpsTarget` will be decreased by `tuningRate` and the `callback` will be execute with the new `fpsTarget`. Likewise, when the measured FPS exceeds `fpsTarget` less `tuningMargin`, then `fpsTarget` will be increased by `tuningRate` and `callback` will be called with the new target. Example usage: // Somewhere at the top of your file import { FpsAutoTuner } from './FpsAutoTuner'; // Then later in your code, probably in your constructor of your game object this.fpsAutoTuner = new FpsAutoTuner({ fsTarget: 30 callback: fps => this.setFpsTarget(fps) }); This assumes that you have a function called `setFpsTarget()` on your class, probably that does something like this: // This is just an example method, on your own class... setFpsTarget(fps) { clearInterval(this._fpsTid); this._fpsTid = setInterval(this._render, 1000 / fps); } Then later in the rendering portion of your code: // inside the render loop of your code, call: this.fpsAutoTuner.countFrame(); That's it! Your app will now automatically adjust it's FPS as needed when it detects lower/higher frame rates available. (FpsAutoTuner automatically starts it's auto-tuning timer in it's constructor.) There are plenty of options you can pass to FpsAutoTuner to tweak it - they are all documented at the top of the gist. Specifically of interest, you can set `tuningInterval` (default 5000ms) to change how often it measures/changes the FPS. This all has just been a humble attempt to give back to the community. Use and enjoy. Contributions/changes/suggestions to the gist are welcome! Download FpsAutoTuner from GitHub here.
  15. 1 point
    I have solution for that thing - custom GlowFilter, but i dont want to publish it without extra preparations, because there are several filters i want to move to special plugin, filters that emulate Flash. I'm afraid that my queue of "who to help and make simple hack in 15 minutes" is too big right now Until then, I suggest to use make progress-bar sprite-basd and prerender everything you can in several frames in photoshop.
  16. 1 point
    Sorry to hear this, it's frustrating and not uncommon for quality games. Locking a game will have limited benefit, don't blame yourself. Practical advice is don't spend more than 5 minutes worrying about it (a DMCA takedown should take less than 5 mins once you've done it a couple of times). Some additional takeaways are: 1) brand future games in multiple ways so stolen traffic still promotes the author and proper licensing channels, 2) develop server-authoritative or partner-publishing strategies for monetization, 3) offer paying customers more value than what they could achieve by stealing, 4) remember a sequel is quicker for the original author to make - and everyone prefers to play the latest greatest - so if stolen games get traction cash in later.
  17. 1 point
    jonforum

    PixiJS Examples

    To be honest I really like the new organization, thank you very much for your work and all the teams your were awesome!. Difficult to target lack example without being confronted in real time, however I can bring some suggestion. In my opinion, I am not very comfortable and not yet study any of the following theoretical notions. So you can take what you want if you want add more basic fun example. Demo on batching and wrong batch hierarchy and theories. Demo on the implementation and setup of customs shadders filters can be take from https://www.shadertoy.com/ https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters https://www.pixiplayground.com/#/edit/5bqI8BM2qadFFt8eCWc7n Demo of a basic view-port and culling stage Demo for get pixel , similar in phazer https://phaser.io/examples/v2/bitmapdata/get-pixel Demo for timeLapse, slow motion the pixijs tikers Demo of pixi-sound plugin. PLUGIN-LAYERS with container mask for lights Let's be a little crazy, a little live inspector and debugger inspired by the work of bfanger https://github.com/bfanger/pixi-inspector ...
  18. 1 point
    Hello! The project is old so PIXI v.3.0.11 is used. For streaming - Flashphoner via WebRTC Steps to reproduce 1. Start video stream in html video element - stream.start(myDiv) which creates streamVideoElement in myDiv 2. When stream fires STREAM_PLAYING event the method PIXI.Texture.fromVideo(streamHtmlVideoElement) is called and the returned texture is set to the specific PIXI.Sprite instance. 3. Somewhere after this the Firefox browser receives error thrown by WebGl: Additional information The problem is happened very rerely Only Firefox Stream(video element) is not failed after the error In the PIXI source code that means: gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source); What we tried tried to set video.crossOrigin = "anonymos" to the video element but no success. tried to dispose video like video.src = "" and etc according some advices related to the localStorage caching I know it's not directly linked by PIXI but still I need help. And the image of the current block when exception was thrown.
  19. 1 point
    Said in that way sounds very trustworthy. Okay I will make more research around. Think the Firefox forum will be affected too. Thank you very much! I will write when something new emerges on the horizon !
  20. 1 point
    That looks like a CORS problem. Can you check what network headers the video (and possibly related preflight request) have in relation to access control?
  21. 1 point
    @ivan.popelyshev, I understand that PIXI is used for rendering only. I don't expect it to have built-in physics methods. I was trying to understand if I'm doing something wrong, as I'm sure a lot of people has encountered the same problem. Thank you for your detailed explanation. I'll definitely wait for the article you've mentioned. @bubamara, thank you too for your suggestion. I'll try to work something out of both your suggestions.
  22. 1 point
    -AAG-

    Is it like backstabbing my clients?

    I want to thank everyone for taking the time to leave a reply. I am taking it all in and think that I might have found a solution that solves this and my level design hate and I may even really like the game(s) that will result from that for a change. I do agree that web games in general are not great and I personally don't play a lot of them. In fact, I feel the same way about native mobile apps and have none installed in any of my devices. I do enjoy how accessible web games are and have found myself surprised by a few of them both when flash was a big deal and now with HTML5. It is this ease of use that I enjoy the most about web games. When It comes to my own games I have to go with what my clients are looking for. There was a time that my main client wanted arcade games and I made quite a few, not great at all but they got sold and spared me the level design dilemma. Then interest shifted to puzzle games so puzzle games it is and they have been selling. I have been doing this for a while and every single game on my catalog has sold multiple licenses (minus the obvious exclusives). I understand that doesn't make them good, that just means my clients liked them and thought them a good addition for their website. I'm sure they know their visitors and I have come to accept that it isn't my concern whether their players like the games or not, but the fact that they continue to buy from me tells me that my work is liked by a certain audience. At the very least I try to make my own thing instead of trying to follow trends or clone this and that because is popular unless the client specifically asks for it. I have avoided plugin to my catalog till now but if anyone wants to take a look you can go over here. Thanks again!
  23. 1 point
    5neia_opo2@google-mail.ooo

    def

    def
  24. 1 point
    ivan.popelyshev

    Pixi js editor

    i think that editor was for phaser2, and phaser2 was built on pixi so you can do something like that , even take some code. I can ask mightyfingers if they are ready to share their old work
  25. 1 point
    Every element can be a sprite with certain "tint" field (red, green, whatever), that way it'll be better. I cant just say "use sprites in all cases" , as I said. For example,. in pixi-v4 sprites are batched but in v5 Graphics are batched too so its cool! However Graphics allows to put many rectangles in it and cache their vertex buffers, you can hold one Graphics per row and re-calculate only when the row is changed, that'll be more efficient than just sprites. I suggest to try Graphics-per-row approach or make 4000 sprites with same texture but different tint. Maybe you can make two sprites per square , one outer and one inner. In any case, Text should be BitmapText because every text element is basically +1 dynamic texture and if you have 4000 of them that'll be huge problem. I wish you look with all of that, post more, post demos, I'll help when you stuck on strange problems.
  26. 1 point
    ivan.popelyshev

    Pixi js editor

    There are solutions but nothing is easy. There's pixi-svg https://github.com/bigtimebuddy/pixi-svg that can take info from svg. There's also Tiled editor and https://github.com/eXponenta/pixi-tiled that allows to take polygons and sprites from it, but I dont remember if it has export to graphics, but hey, you can add it! Currently I work on solution to open SWF files so people would create graphics in Adobe Animate. I think that you can do something for your case, I saw that teams who made games on pixi with their own engine always did their own editors. I do not know why there is no Graphics, I never needed it and I guess people hold their stuff and dont release it I think that https://twitter.com/Pix2d is going to add support to pixi soon.
  27. 1 point
    Noel

    Issue with FB Ads?

    @BerMon Why don't you request those features to the game engine creators then? They are the ones who know and control their engine the best. The only alternative is to make the changes by yourself. For most engines you will find tutorials made by developers who managed to do it.
  28. 1 point
    Sure you can. If you're brave enough you can use webRTC over UDP and create you own UDP stack to handle packet order/drops etc. This has an additional advantage of less overhead in each message and that in turn means possible performance improvements.
  29. 1 point
    HTML5 is establishing itself as a language for everything. Nothing to do with HTML. Now we discover an open source platform that allows you to create 2D and 3D games. It is about Turbulenz. Tubulenz is a platform for creating games based on HTML5 that works mainly with Canvas, WebGL and JavaScript, its engine is very powerful or that is what it shows when using a game or any of the tests we can do with it (try), seeing as it generates complete 3D environments, controlling everything necessary in a video game to perfection (such as cameras, lights, shadows, particle generation...) and with an impeccable performance by the leading mobile game app development company. Using an engine like this one can be very useful, since it speeds up the development process, not to mention that browser games have a certain charm, being able to be played from anywhere without major complications. Well is another example of the growing importance of HTML5. Orient our training to master HTML5 I think it's a good choice.
  30. 1 point
    In many cases you can assume the container size and just add a PIXI.Graphic to that container like so. if (clientConfig.drawChunkGrid && layer.name === 'front') { const grid = new PIXI.Graphics() const text = new PIXI.Text(`${chunkPosition.x}, ${chunkPosition.y}`, { fontFamily: 'ArcadeClassic', fontSize: '16px', fill : '#fff', align: 'center', stroke: '#000', strokeThickness: 4 }) grid.lineStyle(1, 0x000000, 0.6) grid.moveTo(0, 0) grid.drawDashLine(fs * clientConfig.chunkSize.x, 0, 8, 8) grid.moveTo(0, 0) grid.drawDashLine(0, fs * clientConfig.chunkSize.y, 8, 8) chunkContainer.addChild(grid) chunkContainer.addChild(text) } use lineTo instead of this custom drawDashLine. In this case my chunkContainers already have positions and constant dimensions.
  31. 1 point
    themoonrat

    def

    That setting adjusts the delta emitted from the ticker, not how often the ticker is emitted. console.log that delta value and you'll see a difference. If the setting is left alone, if requestAnimationFrame can emit 60 times a second, that delta will come out as `1` as it's hitting it's target.
  32. 1 point
    SarahJ

    Fading trail

    Hi, I'm trying to create a fading trail using minimal graphic/sprite objects. Right now I have an object that is always moving at the same speed and direction, and I would like it to have a trail behind it. I've looked at the mouse trail demo, however, I feel it is unnecessary to use have to use so many objects just to make a linear trail (the trail I need will always be in the same direction), as I'm going to need 10+ trails at once. Here are 2 of the options I've thought of so far: Draw a rectangle graphics object, then use an alpha mask to create a fading an effect: Have a really long sprite as a trail, then use set its frame to the length I need. Which one would be more practical to use, and are there any better methods? Thanks!
  33. 1 point
    Thank you Adam! Would you be willing to share some example code of a barebones working example (if it's easy)?
  34. 1 point
  35. 1 point
    hi @enpu, It looks like I found another small problem with TilingSprites when hires is enabled. config file: game.config = { system: { width: 320, height: 320, scale: false, center: true, resize: false, hires: 2 } }; This is the code. (I added panda@2x.png to the media folder) game.module( 'game.main' ) .body(function() { game.addAsset('panda.png') game.createScene('Main', { init: function() { this.sprite = new game.TilingSprite('panda.png', game.width, game.height).addTo(this.stage); }, update: function() { this.sprite.tilePosition.x -= 100 * game.delta; } }); }); The background now has a gap when it is moved to the left. (This gap is sequential).
  36. 1 point
    Thanks! This should be now fixed in develop version.
  37. 1 point
    For picking the better GPU, there is an option called powerPreference Set it to high-performance and the browser will take that as a hint to use the best GPU available. https://pixijs.download/v4.8.7/docs/PIXI.html#.autoDetectRenderer
  38. 1 point
    good news I have found the perfect solution!!!!!!!!! I didn't know about this feature in HTML5 but there is a thing called "defer" and "async". Apparently all script tags with async will be run whenever they are loaded whilst the script having defer tag will be run in order AFTER all document is parsed and BEFORE document.onload. Hence the solution is: <head> <!--Code that doesn't care about order--> <script src="/lib/skills.js" async></script> <!--Code that cares about order--> <script src="/pixi/pixi.min.js" defer></script> <script src="/pixi/pixi-layers.js" defer></script> </head> @jonforum thank you for giving me a hint with the import and finding this absolute gem!!!!! To hell with the extra document onload loader
  39. 1 point
    new Update : https://www.kongregate.com/games/DragonSlayerZ0/sticky-ricky-lost-in-space
  40. 1 point
    i love the io games like this ❤️
  41. 1 point
    @dataj I already shared the documentation with you: https://developers.facebook.com/docs/games/instant-games/guides/ads-monetization See the "Preload the ad" section to preload the ad when the game starts. See the "Show the as" section to show the ad when the player loses. I am not sure you need to know more than that.
  42. 1 point
    SarahJ

    Fading trail

    I've decided now to use @ivan.popelyshev's method, and I'll get back when I get it working. Thanks, everyone for your replies, I wouldn't have thought of this on my own!
  43. 1 point
    Hi everyone, I'm trying to port an avatar editor made with AS3. The original app makes use of the gskinner Color Matrix class for adjusting brightness, contrast, saturation and hue of each part and stores those values in a DB. So imo I have two options here: 1. Port the class to js and try to use the stored values as they are. 2. Find an algorithm to transform those values to use them with PixiJS Color Matrix Filter directly. As I'm not very good at maths I've tried the 1st option so I ported the class to JS and tried to use it as the matrix for the color matrix filter. Saturation and hue seem ok but I cannot make brightness and contrast adjustments to look similar in as3 and pixi. I've been digging a bit and I've found that in the gskinner class, brightness and contrast are tweaked through the offset column while the color matrix filter in Pixi aren't. I've noticed as well the use of 'colorMatrix.frag' which is a WebGL shader impl but I don't know anything about them so I'm stuck. Do I need to implement a new custom matrix color filter or even a custom colorMatrix.frag (although I don't know anything about shaders as I said)? Any clues on option 2? Is there any other option I haven't take into account may be? Any help or directions would be very much appreciated. Thanks so much! You can see the ported matrix color code here (and I've attached the as3 code just in case): https://www.pixiplayground.com/#/edit/DIPYaphRukZ6rBqIRupVv as3-color-matrix-example.zip
  44. 1 point
    jonforum

    Fading trail

    Masks is to be avoided as far as possible. I use 1 or two only in some context, and my cpu get sick very fast. So for me , no i dont think masks will be more performance friendly than the demo mouse trail . but I suppose it can vary in many contexts. The best and most painful solution will be to test the 2 and check the cpu performance with a debugger SDK or web tools. but in my personals tests, result told me to avoid as much as possible the use of mask in my project. wihout i get ~ 10 to 12% work
  45. 1 point
    ivan.popelyshev

    Fading trail

    OK, I was wrong, I forgot about @jonforum Cache black-white or transparent-opaque grad one time and use tint/darktint on it Gradients are basically 1d textures, use them with height=1. Vertex-coloring is not as versatile, you cant put linearRGB in it, for example.
  46. 1 point
    nice game
  47. 1 point
    Hello guys, I realize that my sprites were beautiful when I zoom in and quite ugly when I zoom out, so I decided to define two sprites to keep a good quality in zoom out or in: this._zoomOut[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,0.5)); this._zoomIn[name] = new PIXI.Sprite(PIXI.Texture.fromImage(name,undefined,undefined,1)); when I use this two lines of code separately it works well. But when I use both of them, the second call doesn't apply the 4th parameter "sourceScale". It means this._zoomIn[name] receives a sprite from a texture with 0.5 of sourceScale too. That's super weird, are there any cache to clear?
  48. 1 point
    Added to https://github.com/pixijs/pixi.js/wiki/v4-Resources , and i'll ask owner of pixi-awesome to add there too If you post it as separate thread, i'll pin it
  49. 1 point
    sable

    Propagating mousewheel event to parent?

    Hi there. Just did a similar test to Wingy, and looks like babylon doesn't block the events, http://www.babylonjs-playground.com/#C3ZPAS. Looking at your page source, I think the issue is that the scene is embedded in an iframe. You should be able to send the event (or a message) from the iframe to the parent either via window.parent or window.Postmessage
  50. 1 point
    The Ticker documentation is here: http://pixijs.github.io/docs/PIXI.ticker.Ticker.html And here: (It makes reference to using PIXI.ticker.shared) http://pixijs.github.io/docs/PIXI.ticker.html Although, I tend to prefer to use the code as my documentation: http://pixijs.github.io/docs/core_ticker_Ticker.js.html Essentially, PIXI.ticker.shared is an instance of the PIXI.ticker.Ticker class. This instance is used by the Interaction Manager, although I'm trying to figure out why since it seems unnecessary (nobody has responded to my post yet). Of course, you are free to use the same instance, but keep in mind if you modify how it behaves, anything internal to PIXI that uses it may be affected. The PIXI Ticker is based on requestAnimationFrame, so in function, it is little different from running your render loop manually using requestAnimationFrame. But the object's event interface may be more attractive to use and look at since it involves less code. Beyond this basic function, it offers these features: 1) Usability: You can start and stop it easily. 2) Efficiency: It auto-starts (you can disable this) when there are listeners/callbacks, and auto-stops when there aren't any. 3) Throttling: The requestAnimationFrame callback is passed the current time as an argument. But the ticker callback is the number of frames that should have been rendered since the last call, depending on your target frames per second. By default, PIXI.CONST.TARGET_FPMS (target frames per millisecond) is set to 0.06, which means you are targeting 60 frames per second. In a perfect world, it would always say 1. But if the browser lagged really bad, it might say 60, if it has been a whole second since the last call. One possible use of this argument is to skip frames if it has a value >= 2. Or, let's say you have a sprite moving from A to B. It is supposed to move 2 points per frame, but the callback handed you 1.5 (which, if consistent, equals 40FPS). That means you can move the sprite 3 points this frame instead of 2 to maintain the desired speed. 4) Throttling: The number of frames passed to the callback can be capped to a maximum value. So to use the sprite movement example from #3, you can make sure the sprite doesn't jump too-large a distance in a single frame - even if the browser is lagging badly. 5) Throttling: The number of frames passed to the callback can be multiplied. So to use the sprite movement example from #3, you can increase (i.e. multiply by 2) or decrease (i.e. multiply by 0.5) animation speed. 6) Usability: You can add callbacks that should be called only once by the ticker as opposed to a constant loop. 7) Usability: You can add or remove multiple callbacks at will. All callbacks will be called in the same frame, so that multiple animations may be managed separately, but rendered in sync. requestAnimationFrame supports this also, but keeping track of those request IDs can be more painful. 8) Usability: You could just stop the ticker and trigger callbacks manually. For example, you could allow a user to stop the animations and present a button that allows them to step through frame-by-frame. In essence, you got a bunch of little features here that cater to creative situations, but aren't useful in many scenarios. But the idea of wrapping requestAnimationFrame into an object that may be manipulated carries with it a lot of potential. Feel free to ignore it or use it, depending on your situation.