• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by themoonrat

  1. themoonrat


    What you're looking for is a mask
  2. I find that a video needs to be played for seeking to work in updating the video being watched. So try seeking, then a play, then a pause again.
  3. The reality is, everywhere supports 4096x4096. But! If, during your app, a texture is required to be rendered from an atlas not yet in the GPU memory, then a 4096x4096 texture is going to take longer to upload to it, and, in my experience, cause a micro stutter in the app on older mobile devices. So I used 2048x2048. Not quite as efficient as more atlases required.. but texture swapping doesn't effect gameplay. Now, depending on your app, that may or may not be a problem for you! You might be able to guarantee all base textures are uploaded to GPU using prepare plugin before being used, or you might only be targeting desktop, or might not have many textures so no multi-texture swapping is required.
  4. Yep, PixiJS is made for the normal browser environment... so anything outside that is out of the project scope. But there polyfills out there and a few specific pixi projects to enable it to work elsewhere
  5. When you're not using a preloader... the width is 1 until the image had been loaded. We can't know the true width of something if it's not been loaded yet. When it has, an event on the texture is fired and the true value can be known. If using a loader, then it'll give you the references to things it loads which you can pass in elsewhere. The built in loader will add textures loaded into PIXI.utils.TextureCache that you can reference from anywhere.
  6. I believe the prepare plugin, to upload textures to the GPU, also uses the system ticker, to try and not flood the GPU with tons of uploads all in 1 frame
  7. In the event data, there is a flag called 'isPrimary'. So you could ignore events where that isn't true to effectively disable multi touch?
  8. For your first request, it can be achieved by creating a Blur filter on the text. Now tween the strength of the blur whilst also tweening the alpha for the text, and you should have the effect you require. For the latter: do you have an example that you could show please to help visualise the effect?
  9. Correct. Animations and such should always be based on time rather than frames to ensure things occur at a consistent speed regardless of fps. You'll often see 'delta' used in rendering engines. Some have delta as 'the amount of time passed since the last time an update occurred' and some have it as a number which has '1' running at normal speed, and '2' meaning the engine is running at half the fps. Then you can multiply the delta by your movement amount and voila.
  10. Unfortunately this is the limitation of using the Canvas API to draw text onto a canvas, which then becomes the texture for a Sprite. Isn't what you need, but was one persons way of mixing Pixi and the DOM together
  11. I'd just call destroy As part of the DisplayObject's destroy function, it has the following code, that removes itself from any parent it has if (this.parent) { this.parent.removeChild(this); }
  12. You can access the raw html video via videoSprite.texture.baseTexture.resource.source So from there you can set the currentTime to manually change the play location -
  13. I've added a pr to make updateText public!
  14. Haha np! If there's one thing I've learnt in programming: we're all dicks at one stage or another!
  15. asset.interactive = true; Rather than your setInteractive property
  16. You'll get the same result in doing both. If you were gonna reuse that texture in other Sprites later on, it might be handy to have a reference to it? Otherwise I'd use the 2nd because it's quicker to type
  17. Good effort without looking Ivan! It's texture.baseTexture.resource.source
  18. I wonder if text metrics are sometimes being generated before the font has actually finished loading, thus spacing is thrown off when it then generates text with the loaded font. You often need to have used a custom font once in the dom before it'll then work everywhere else. I reckon isn't miles away from what your issue is. Different symptoms to the same underlying issue.
  19. I use to load custom fonts, which handles the required hackery for you!
  20. Yeah I noticed that. The icon didn't quite give away what it was at first glance, but the arrows gave me a hint to move around the screen after toggling it to discover what it did, and it's a super useful addition. Tick and cross arrows to place down might need to be made a bit more noticable? But it's a big step up from where it was for mobile usage. And something easy to explain to users in a tutorial.
  21. So just tried on my tablet, and I'm able to select built items fine. Odd (but good!). Couple more issues... 1. All the menus look fine in portrait apart from the upgrades menu, which doesn't show the X in portrait mode, so can't click off of it. 2. If I use the pinch action to zoom in as much as I can, I can then press the zoom icon to zoom further into a black void. Scary.
  22. That sorts out the scaling issues on my phone, and it nicely works either portrait or landscape... nice work! There's now the issue on the phone that you can't select certain things, like existing machines, or build items (tho you can open a build menu fine) The first issue is interesting, as to move the game around you have to touch the screen, so maybe it's best an existing machine info doesn't keep popping up all of the time! Maybe a question mark icon you can press which then let's you select anything on screen to view it's info? Dunno. UI's do have to be different from mobile to desktop, so it depends how far you want to take this being a good mobile/tablet experience
  23. Hey again Jammy! I remember last time this was posted! It's looking good. So putting my old tester hat on... In terms of setup of tech... You say it's got tablet controls... but loading on a phone it's zoomed in to a tiny area with no way to pinch to zoom out or anything Use m4a rather than mp3. Better sound quality for same bitrate, and it's much better at looping audio than mp3 can ever be Get loads of console errors due to the kaching in my console. Consider using an off the shelf lib like Howler to handle audio? Performance wise it all held up fine to me! In terms of gameplay Set a limit to zoom in and zoom out via mouse wheel. I was able to lose the game location by zooming out too far! I like the blue squares to tell which way items are facing... but since the floor is blue, it's still really hard to tell! And sometimes the 'blue' is underneath the machine itself. In the hell zone, bring up one of the middle fireball machines. First, the X to close the details I didn't notice at first, because it's a fair way from the box itself. But you click it... and the details come back, because behind the X is another Fireball machine and I guess the click isn't blocking propagation! Arrow keys to move about the map would be nice. I found Two Point Hospital got camera movement for this kinda game right. I something things 'linger' too long when I've select something. If you have a chair selected, I don't want to have to go down to the x to not select it anymore. I want to press something to stop having it selected. Right click without scrolling? Dunno! I click on upgrades, and I've still got the chair selected! I feel a similar thing with some of the ui.
  24. By having the bitmap textures twice as big The PIXI.Text class generates it's own textures for display text using the canvas api, and so you can adjust the resolution to generate high / lower res text. But PIXI.BitmapText relies on the texture you supply it. So if you want it to be a higher resolution, you need to supply a higher res texture (or a larger font size that you can then scale down)