Jump to content

Pastaspace

Members
  • Posts

    60
  • Joined

  • Last visited

Posts posted by Pastaspace

  1. I have a basic options menu that, in order to show all the options, is drawn on a different before that buffer's colortexture is drawn:

     

    Buffer* bf_normalBuffer;
    Buffer* bf_resizeBuffer;
    Texture* tt_drawingTexture;
    
    //At initialization
    bf_normalBuffer = Buffer::GetCurrent();
    bf_resizeBuffer = Buffer::Create(1600, 900);
    
    //Code within the drawing function itself
    Buffer::SetCurrent(bf_resizeBuffer);
    bf_resizeBuffer->SetColor(Vec4(0, 0, 0, 0));
    bf_resizeBuffer->Clear(bf_resizeBuffer->Color);
    Context::GetCurrent()->SetBlendMode(Blend::Alpha);
    Context::GetCurrent()->SetColor(Vec4(1, 1, 1, 1));
    
    //Draws text code goes here
    //Then switches back
    
    tt_drawingTexture = bf_resizeBuffer->GetColorTexture(0);
    Buffer::SetCurrent(bf_normalBuffer);
    Context::GetCurrent()->DrawImage(tt_drawingTexture, 0, 0, 1600, 900);
    Context::GetCurrent()->SetColor(Vec4(1, 1, 1, 1));
    

     

    Here's the issue. When using this code (rather than just drawing the text without switching buffers), the text on screen is a lot less fuller, and the color is a lot more washed out.

     

    A comparison:

    polP4HC.jpg

     

    Versus it with the buffer code

    Hle42b0.jpg

     

     

    So what exactly is the issue? Is there some setting or aspect of buffers I'm missing?

  2. I read some stuff saying that Leadwerks seems to support this, but I can't fully understand how to implement it. I have a few icons I'd like to be vector graphics (mostly UI things) so that they look better when scaled. How do I do this?

     

    I've got an .svg file now, but obviously that doesn't import.

    .psd files did import, but they ended up as just normal textures that when scaled, look squashed or weird.

    Does Leadwerks have some sort of support for this?

  3. I understand that when using CharacterPhysics for an object, the physics shape will always been a cylinder. The question is, can I tweak any other aspect of it, such as its size? I've got small enemies and large enemies, and there are places that the small enemies can go that the big enemies (whose collision is the same size), shouldn't be able to go.

  4. Rendering text relating to dialogue, inventory, stats, general RPG stuff.

    The text usually doesn't change that much while accessing these menus (there's highlighting if you mouse over it and that's about it), how would I go about rendering to a texture? Even a few frames saved is nice.

  5. I asked myself the same question, and it definitely is DrawText, nothing else in the code slows things down, and eliminating those lines speeds things back up to normal. After more than a few calls, like 8 or so, it starts to drop about 12 FPS, and then it just goes down from there.

  6. I've got a string that has a newline in it, IE something like

    string s_myString = "Hello \n world.";
    

    But I noticed that while normally said string would be output on two lines. When using DrawText, it wouldn't show the newline character, but wouldn't put the next bit of text on a new line.

    Am I missing something here, or is that just a limitation of DrawText?

  7. Is it possible that we can have Sounds load from files that aren't .wav format? .wavs tend to be pretty big in size, especially when we're talking about songs that can be several minutes in length, which can lead to a few problems. Having support for MP3s or .ogg would be extremely nice.

    • Upvote 2
  8. I've noticed that whenever a character controller (the player, or some NPCs) collides with a particularly complicated static object, the framerate drops to an absolute crawl.

    Now, I understand why this happens, my main question is, how do I prevent it? Is there some way I can generate a polymesh/phy object for these models that's less complicated and less intensive, or something else?

  9. When it comes to collision types, you have all your basic ones, Prop, Scene, Character, Trigger, Debris, Projectile, LineOfSight, etc.

    However, is it possible to define additional collision types, other than the defaults, and add them to the big table of existing collision types? If so, how?

  10. It does:

    http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/sprite/

     

    Basically, just use SetSize() to make it really long and skinny, and then set the view mode to 6:

    http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/spritesetviewmode-r832

     

    That will make it rotate around its own Z axis, so you just point the sprite entity wherever the laser beam should point and it will look right.

     

    This is how I did the bullet tracers in the FPS weapon model pack.

     

    Alright, what are the rules for loading files in for sprites, just flat .mdl files? .tex files?

    Also it doesn't seem that the C++ class for sprite has a SetViewMode function.

  11. Been messing around with 3.3, I noticed on the release page is says we can use the new Sprite class to easily make tracer rounds and laser beams, which sounds sweet.

    But uh, how would one go about doing this? The Sprite class doesn't seem to have any documentation yet.

×
×
  • Create New...