-
Posts
2,953 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by Roland
-
-
You have to check the mouse position Z component
class SomeClass { float _lastMZ; ... void Init() { _lastMZ = Window::GetCurrent()->GetMousePosition().z; } void UpdateWorld() { auto mz = Window::GetCurrent()->GetMousePosition().z; if ( mz != _lastMZ ) { // mouse wheel moved // distance is mz-_lastMZ _lastMZ = mz; } } };
- 1
- 1
-
-
I can understand that all kinds of special effects should be user supplied. However fog is such a basic need. All engines I have tested have fog as that is the normal way to minimize the camera range. Well it's up to Josh to decide. Fog in my view is not an effect. It's a basic feature.
- 5
-
Its quite surprising that Leadwerks doesn't have official supported Fog as thats more or less needed in most programs. In some less and in some more. So please Josh! Come on - give us some fog.
- 5
-
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
-
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 }
-
As this now has gone wild I can learn you two Swedish words that are really really easy
Island = ö
Small river = å
-
-
I've added a new Font::Load() command that will accept any string of characters as the glyphs to pull from the font. However, I do not exactly know how this will work. It's all kind of strange to me, being a native English speaker everything else seems like some weird exception.
Anything that can be tested?
-
Okay. So at the moment its not possible then (my font has the Swedish åäöÅÄÖ).
å (0xe5)
ä (0xe4)
ö (0xf6)
Å (0xc5)
Ä (0xc4)
Ö (0xd6)
Thanks for the answer
-
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?
-
Whow! I have tried but gave up Congratz !!!
-
Yes this shows why I also stopped using FlowGraph
-
Awesome and thank's Aggror
-
The Zip file is corrupt
-
Totally off topic. What's that music?
-
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
-
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.
-
Hard to tell what the problem is without having the project, could be more ore less anything.
-
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; }
-
what does the Leadwerks log say.
You will find it in "Your documents folder\Leadwerks\Leadwerks.log"
-
-
"preloadWorld:Hide()" ... another of those undocumented things? Can't find that one
-
Couldn't say it better than Aggror, except even more patience, trial and error of course There are no shortcuts
- 2
Mouse wheel question
in Programming
Posted