Jump to content

hubert

Members
  • Content Count

    96
  • Joined

  • Last visited

About hubert

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    ttt

Recent Profile Visitors

1453 profile views
  1. That is very true! I had many problems with performance of my game loop since I wanted to have many cool visual effects. I CANNOT UNDERESTIMATE how big performance boost I had after not rendering objects that are offscreen. My advice to you is to use visible false property on sprites or displayObjectContainers. Under the hood this is one of the initial checks the engine makes before rendering and you can simply turn the object on with one line of code (if removed you would have to re-instantianate it agian, as well invisible objects can change position in your game loop). http://ww
  2. Will removing children from sprites have significant impact on rendering speed?
  3. yup. i had a similar situation when wordWrap was set to true. When set to false the space between new lines is ignored. The text is broken by the container or do you do it manually? This is my configuration: var text = new PIXI.Text("Pixi \n it works! :D", { font:"20px Arial", fill:"white", wordWrap : false, dropShadow : true, dropShadowDistance : 2 });also for new line you can you can use htmlentity 10; http://www.sevenative.com 10;
  4. @ Hey! Actually there is another way of creating an array of sprites. This is the code from a recent question about something else. var birdIdle = PIXI.BaseTextureCache[GAME.Assets.BIRD_IDLE];var partTexturebirdIdle0 = new PIXI.Texture(birdIdle, new PIXI.Rectangle(0, 0, 470, 470));var partTexturebirdIdle1 = new PIXI.Texture(birdIdle, new PIXI.Rectangle(470, 0, 470, 470));var partTexturebirdIdle2 = new PIXI.Texture(birdIdle, new PIXI.Rectangle(470 * 2, 0, 470, 470));var partTexturebirdIdle3 = new PIXI.Texture(birdIdle, new PIXI.Rectangle(470 * 3, 0, 470, 470));var partTexturebirdIdle
  5. YES. Sprites need children. For example my main player sprite has children with info about his health, name etc. for other players to see in myltiplayer game. So when moving my sprite I simply change the position and don't pay attention to metadata about the player contained as children text and graphics. My question to you is will it improve the rendering speed significantly? http://www.sevenative.com
  6. I have been researching this topic by myself. I don't know if this helps but this is how i create a rotating coin like in mario with pixijs var coin; for(var i = 0; i < 10; i++){ var position = i * 46; var frame = new PIXI.Texture(PIXI.BaseTexture.fromImage('assets/images/world/objects/coin.png')); frame.setFrame(new PIXI.Rectangle( (i * 40), 0, 40, 40)); if(i === 0){
  7. Well basically what he is refering to is creating a loop for the game. A game loop is a function that performs some actions every iteration it makes. I actually looked at the video and what he is refering to as a a bad design is that everything between request animation frame and animate function is packed into one. What you should actually do is to design actions that have to be done during one iteration over your loop. Usually it is 01. take input. 02. Move player 03. Perform collsion checks. 04. In some cases broadcast the game state to other players 05. render the game stage Desig
  8. Yes you can, redner to texture is what you are looking for, with this you can render many elments (sprites graphics etc) into one texture and use it agian as "one", my sugesstion for you is to use a separate displayObject Container and render everything into it. Then you can move the display object container with one sprite insteda of having a display object container with many dead bodies. Please refer to this in order to see working code examples: Rendering http://www.html5gamedevs.com/topic/6507-display-object-container-to-an-imagesprite/#entry38726 Trimming the element in newer
  9. If you want to use it with graphics you'll have to pass it with buttonMode = true; A short snippet for graphics; var slot = graphics.drawRect(slotData.X, slotData.Y, _square, slotData.sltHeight); slot.b_id = slotData._id; slot.b_number = slotData.b_number; slot.type = slotData.type; slot.interactive = true; slot.buttonMode = true; slot.hitArea = new PIXI.Rectangle(slotData.X, slotData.Y, _square, slotData.sltHeight);http://www.sevenative.com https://play.google.com/store/apps/d
  10. No do not initialize all views at the same time. My advice... Create a stage -> scene (display objectContainer) and then add views to it. The scene will be a wrapper for all of your elements! A good practice is to call different views every time you need! Here is my code. What you can do is to clear the scene in order to free some memory. THIS IS MY MAIN VIEW ROUTER CLASS _li.define( 'bitwars.views', function ( renderer, scene, loading, mainRouter, main, game, choseName, game
  11. Please do not use any hidden inputs! It is a rabbit hole!!! You wont be able to to use native wrappers like ejecta, completely misses the point of creating this plugin - no DOM elements inside pixi game. Hidden inputs sometimes trigger themselves in mobile browsers! FOR THE LOVE OF GOD DO NOT USE THE HIDDEN INPUTS!!! I BEG YOU!!!
  12. Could you please show us how are you trying to move the mask in your code? Are you moving the sprite or the mask itself? A little snippet would be useful! http://www.sevenative.com https://play.google.com/store/apps/details?id=pl.com.wojciak.kontakt.new_words
  13. great. I started to implement my own Pixi plugin but your seems more smooth! Publish it on git hub! It could gain some traction! +1 for json configuration. i did it the same with my plugin! How are you planning to implement select method and inserting caret between the letters of the word? Additionally I added a value property to the input element. Is it the same in your plugin?
  14. Exactly what I need! How do you instantiate the plugin? Is it going to be done the same way?!
  15. Yeah, I started to play around with it today and i have a working POC but with some bugs, and only input element. The thing is that I am completely allergic to dom in canvas games. Without using pixi there are many libraries doing something like that but in case of pixi everything has to use a normal dom input tag appended to the body element and that sometimes messes up my layout! https://play.google.com/store/apps/details?id=pl.com.wojciak.kontakt.new_words&hl=en http://www.sevenative.com
×
×
  • Create New...