Jump to content

TR-i

Members
  • Content Count

    17
  • Joined

  • Last visited

Everything posted by TR-i

  1. TR-i

    PIXI Sound Filters

    sound.filters = [new PIXI.sound.filter.TelephoneFilter()]; Throws an error. sound.filters = [new PIXI.sound.filters.TelephoneFilter()]; Does not. However, there seems to be no change in the sound after adding the filter. Tried Distortion and Reverb filters- no difference.
  2. TR-i

    PIXI Sound Filters

    All I know is, this throws an error: const sound = new PIXI.sound.Sound.from('data:audio/mp3;base64,' + audiodata); sound.filters = [new filters.TelephoneFilter()]; As does this: const sound = new PIXI.sound.Sound.from('data:audio/mp3;base64,' + audiodata); sound.sound.filters = [new filters.TelephoneFilter()];
  3. TR-i

    PIXI Paint

    I've been trying to learn how to use RenderTexture. At first I misunderstood how it works (thought you could draw to it multiple times, but it simply erases itself every time there's a new draw). I stumbled on a thread where someone was trying to paint with PIXI and there was not much support for it. It dawned on me that it can be done, and it isn't super-complicated. The result is a bit crude but easily improvable. To keep it modular, I've built it into a object: function pixipaint(w, h, c){ //width, height, color const me = new PIXI.Container(); me.back = new PIXI.Graphics(
  4. Example: function _testvideo(v){ videotexture = PIXI.Texture.fromVideo('data:video/mp4;base64,' + v); i = new PIXI.Sprite(videotexture); i.anchor.set(0.5); i.x = stagecenter.x; i.y = stagecenter.y; app.addChild(i); videotexture.baseTexture.source.play(); } I get the first frame of video, then PIXI throws this error: videotexture.baseTexture.source.play is not a function Also tried videotexture.baseTexture.resource.play (per docs). Same result. Also tried starting playback from a different call to make sure the video was loaded. Same
  5. TR-i

    PIXI Sound Filters

    Just want to experiment with the built-in filters.
  6. Does anyone have some example code on how to implement PIXI sound filters? Tried parsing the code on the example page but it's pretty obtuse.
  7. TR-i

    Nested Containers

    My project is not a game or website. Imagine a content management/presentation system based on interactive TV. HTML5 running inside a standalone app, not a browser. That's why the stage is 1920 x 1080- full HDTV standard.
  8. TR-i

    Nested Containers

    Thanks Ivan- making some progress. The width and pivot calls were just me being desperate. My project is somewhat complicated. I am double buffering the screen so I can have transitions and each container (buffer) has 2 containers- one for display objects (non-interactive) and one for compound devices (interactive). That's why there is a "screen0"... because there is also a "screen1". Objects and devices are created dynamically. No display objects are hard-coded. Everything onscreen is drawn with PIXI- there is no CSS (except to create textures) or HTML (except to hold Javascript).
  9. TR-i

    Nested Containers

    const stagewidth = 1920; const stageheight = 1080; var screen0 = new PIXI.Container(); screen0.name = 'screen0'; app.stage.addChild(screen0); screen0.backdrop = new PIXI.Graphics(); screen0.backdrop.name = 'backdrop'; screen0.backdrop.beginFill(0xFFFFFF,1); screen0.backdrop.drawRect(0,0, 1920 , 1080); screen0.backdrop.endFill(); screen0.backdrop.tint = 0x7F7F7F; screen0.addChild(screen0.backdrop); var objects0 = new PIXI.Container(); objects0.name = 'objects'; objects0.width = stagewidth; objects0.height = stageheight; objects0.pivot.x = stagewidth / 2; objects0.pivot.y = stageh
  10. TR-i

    Nested Containers

    I'm sure the answer is simple but I've spent all day on my issue. I create a container and add it to the app.stage. I create a second container and add it to the first. If I add a sprite object to the first container it appears on the stage. If I add it to the nested container nothing appears. I've confirmed that there is a child inside the nested container, but can't see it.
  11. TR-i

    BeginTextureFill

    The Result: TextureFill.mov
  12. TR-i

    BeginTextureFill

    I'm using Livecode, descendent of Hypercard. Great for interfaces and asset management, terrible for display. Produces executables for OSX-iOS-WIN-ANDoid and though I'm not targetting it, Linux. It even has a very clunky pure HTML5 target. Additionally, the kernal is open source.
  13. TR-i

    BeginTextureFill

    My project is not a game or website, it's a content delivery and social media platform with built-in authoring. It is metaphorically similar to television in that emphasis is on a kinetic environment that is more presentational than interactive. Since contributors can define their own space, I can't make assumptions about what they might want to design and have to offer the broadest range of possibilities and still keep the process simple and codeless. I chose PIXI after hammering all the best supported libraries because, unlike something like p5, screen entities are true objects tha
  14. TR-i

    BeginTextureFill

    Thanks for your help, Ivan. I've finally wrangled my textures into conformance: (me is a graphic sprite, txtr is a pre-created texture) me.txtr = txtr; // ratio between sprite size and texture size let xr = me.w / me.txtr.canvas.width; let yr = me.h / me.txtr.canvas.height; let m = new PIXI.Matrix(); m.scale(xr,yr); m.translate(-(me.w/2),-(me.h/2)); me.beginTextureFill({texture:me.txtr.canvas, matrix: m});
  15. TR-i

    BeginTextureFill

    Haven't programmed much Actionscript. I'm creating textures as separate objects that could be applied to a number of sprites. Many of them are procedurally created on canvasses provided by Pixi and some are animated. I'd like to understand what beginTextureFill assumes about the texture and its placement within the drawing boundaries. Also, would it be best practice to create all textures at something like 512x512 and how does this affect scaling in sprites that use them?
  16. TR-i

    BeginTextureFill

    Since graphic sprites have no anchors, the only way to position a texture used with BeginTextureFill is the defaultAnchor of the texture. However, changing the defaultAnchor seems to have no effect. I've tried every combination of anchoring and positioning and this is the consistent result (below). Both texture and sprite are the same dimensions (400 x 400).
×
×
  • Create New...