Jump to content

Roland

Members
  • Posts

    2,953
  • Joined

  • Last visited

Everything posted by Roland

  1. Hi What's needed to get the Fog shader included in Shadmar's PP-shader pack working in C++. I thought this was the only thing to do but the result is no fog at all. Adding the fog to the editor works and gives a nice fog, but only in the editor auto cam = reinterpret_cast<Camera*>(lb.getEntity("cam")); // this is my camera cam->AddPostEffect("Shaders/PostEffects/02_pp_fog_by_klepto.lua"); cam->SetKeyValue("fog_fogrange", "0,20"); cam->SetKeyValue("fog_fogcolor", "0.57,0.53,0.55,1.0"); cam->SetKeyValue("fog_fogangle", "5,21"); cam->SetKeyValue("fog_fogislocal", "0"); In editor In C++ program
  2. As you can see from the code example below SetMousePosition ignores the Z-value auto win = Window::GetCurrent(); auto mp = win->GetMousePosition(); // mp = { x=1000.00000 y=478.000000 z=7.0000000 } win->SetMousePosition(11,22,33); mp = win->GetMousePosition(); // mp {x=11.0000000 y=22.0000000 z=7.00000000 }
  3. As this now has gone wild I can learn you two Swedish words that are really really easy Island = ö Small river = å
  4. Hahaha.. sorry for that Here is a fully normal Swede ... (me?)
  5. Okay. So at the moment its not possible then (my font has the Swedish åäöÅÄÖ). å (0xe5) ä (0xe4) ö (0xf6) Å (0xc5) Ä (0xc4) Ö (0xd6) Thanks for the answer http://www.asciitabell.se/
  6. My code supports the game in different languages (actually English and Swedish for now, but its quite easy to add more languages). Switching language works just fine. However Ascii-characters above 0x7F are not rendered correctly or not at all. Is the any workaround or fix for this (C++)? Question for Josh? Will Leadwerks be able to deal with extended character sets in the future?
  7. Whow! I have tried but gave up Congratz !!!
  8. Awesome and thank's Aggror
  9. The Zip file is corrupt
  10. I use GIT although I'm alone. Perfect backup and great when I need to step back one bit and look what I did last time that caused some problem.
  11. Script.box = "" --entity Script.material = nil function Script:Start() self.material = Material:Create() self.material:SetColor(1,0,0) end function Script:Collision(entity, position, normal, speed) self.box:SetMaterial(self.material) end
  12. Interesting thoughts. I can see you are moving towards LUA and that's a good move I think. I started off with just LUA but found that some things as SQL was better done in C++ at this moment. So now I have a bit of same approach with a base in C++ for data store and keeping track of items that needs storage, besides that most things are still LUA. Thanks for this interesting post
  13. Roland

    Slogging On

    Yes so true, been there, done that way to many times
  14. I woulf strongly recommend you to learn LUA scripting. Start of easy, check the tutorials and go in small steps. You won't regret the time spent.
  15. Hard to tell what the problem is without having the project, could be more ore less anything.
  16. To use C++ you should open Projects\Windows\<your projectname>.sln in Visual Studio and compile. If you don't want Main.Lua to be executed you can go for a more clean approach and replace main.cpp with something like this #include "Leadwerks.h" #include <sstream> using namespace Leadwerks; int main(int argc, const char *argv[]) { // Initialize Steamworks (optional) // Steamworks::Initialize(); // Create the app window Window* window = Window::Create("My Game", 0, 0, 1024, 768, Window::Titlebar); // and some context to draw on Context* context = Context::Create(window, 0); if (context == nullptr) { return 1; } // The world containg all objects World* world = World::Create(); // Load a map into the world if (!Map::Load( "Maps/start.map" ) { return 2; } // Loop until window is closed or user presses ESCAPE bool showstats = false; while (!window->KeyDown(Key::Escape) && !window->Closed()) { Time::Update(); world->Update(); world->Render(); context->SetBlendMode(Blend::Alpha); showstats = window->KeyHit(Key::F11) ? !showstats : showstats; if (showstats) { ostringstream fps; fps << "FPS: " << Math::Round(Time::UPS()); context->SetColor(1, 0, 0, 1); context->DrawText("Debug Mode", 2, 2); context->SetColor(1, 1, 1, 1); context->DrawText(fps.str(), 2, 2); context->DrawStats(2, 22); context->SetBlendMode(Blend::Solid); } context->Sync(true); } return 0; }
  17. what does the Leadwerks log say. You will find it in "Your documents folder\Leadwerks\Leadwerks.log"
  18. Sorry but I just have to say this is so funny
  19. http://www.leadwerks.com/werkspace/blog/110/entry-1058-third-person-camera-code-walk-through/
  20. "preloadWorld:Hide()" ... another of those undocumented things? Can't find that one
×
×
  • Create New...