Jump to content

L B

Members
  • Posts

    967
  • Joined

  • Last visited

Everything posted by L B

  1. L B

    Custom Buffer

    Why am I seeing IntPtr's? This is not part of my headers.
  2. L B

    .NET Headers

    Once the source is complete I'll post it, although a DLL can be used with any .NET language and is easier to integrate. If you don't obfuscate your code, this DLL gets distributed with your executable, and is just like giving away headers + engine.dll, which are the core of Leadwerks.
  3. xPos = ScreenWidth() / 4; So to transfer your value (0.25) to what could be used, use: int XPercentToPixel(float percent) { return percent * ScreenWidth(); } int YPercentToPixe(float percent) { return percent * ScreenHeight(); } If you have an alpha channel in a DDS file you render to the screen, transparency will be enabled. You cannot have alpha programmed, as far as I know. I suggest using the OOP drawing approach in my C# wrapper, if that's not too much of a hassle for you. Porting is easy too. More information here.
  4. L B

    .NET Headers

    Initial release. Please post bugs and whatnot. This is not made for your game, as it is not dotfuscated. If you want to use it, dotfuscate the headers before using them. It is illegal not to do so. Please refer to this thread now: http://leadwerks.com/werkspace/index.php?/topic/602-c-headers-mini-roadmap/
  5. L B

    C# Framewerk

    For now I am reserving this post for when I'll be done with the Framewerk. I'm progressing quite well
  6. L B

    .NET Headers

    This thread is outdated. Please see: .NET Leadwerks wrapper on Google Code This wrapper and its child projects are being developed and maintained by TylerH, ZioRed, klepto2 and myself. Enjoy Leadwerks for .NET!
  7. If you're not planning on any intense game, I suggest you simply copy an example code for LUA integration from a C++ or BlitzMax tutorial, then make your whole game in LUA. Or you could wait for my C# wrapper, which will have an all-in-one LUA integration, such as "Scripting.Initialize();".
  8. Awesome news. Interesting charts, too.
  9. If only we could edit a GMF file to either group surfaces or change the .mat file of a surface. I'd be fully happy.
  10. How would I access these objects? I just want to place my streetlamp entity and it already has the light on it. I copied the code from the point light script into the streetlamp script, and it works fine. I have a point light, but at the origin of the model, which is way too low. How would I go making "entity.light" move up? I tried "entity.light:Move(0, -2, 0)" but this doesn't work. dofile("Scripts/base.lua") -- We need the base class entity function InitDialog(grid) base_InitDialog(grid) group=grid:AddGroup("Light") group:AddProperty("Resolution",PROPERTY_CHOICE,"256,512,1024,2048") group:AddProperty("linearoffset",PROPERTY_FLOAT,"0,1,2","Linear offset") group:AddProperty("multoffset",PROPERTY_FLOAT,"0,1,2","Multiplicative offset") group:AddProperty("Range",PROPERTY_FLOAT,"1,100,0") group:Expand(1) end function Spawn(model) local entity=base_Spawn(model) entity.model=model entity.light=CreatePointLight(10,model) return entity end function GetKey( model, key, value ) local entity=entitytable[model] if entity==nil then return value end if entity.model==nil then return end if entity.light==nil then return base_GetKey(model,key,value) else if key=="linearoffset" then return entity.light:GetShadowOffset(0,0)--..","..entity.light:GetShadowOffset(0,1)..","..entity.light:GetShadowOffset(0,2) elseif key=="multoffset" then return entity.light:GetShadowOffset(1,0)--..","..entity.light:GetShadowOffset(1,1)..","..entity.light:GetShadowOffset(1,2) elseif key=="range" then return entity.light:GetRange() else return base_GetKey(model,key,value) end end end function SetKey(model, key,value) local entity=entitytable[model] if entity==nil then return 1 end if entity.model==nil then return 1 end if entity.light==nil then base_SetKey(model,key,value) else if key=="resolution" then if value=="0" then entity.light:SetShadowmapSize(256) elseif value=="1" then entity.light:SetShadowmapSize(512) elseif value=="2" then entity.light:SetShadowmapSize(1024) elseif value=="3" then entity.light:SetShadowmapSize(2048) end elseif key=="range" then entity.light:SetRange(value) elseif key=="shadowresolution" then resolution=entity.light:GetShadowmapSize() if resolution==256 then return 0 elseif resolution==512 then return 1 elseif resolution==1024 then return 2 elseif resolution==2048 then return 3 else return -1 end elseif key=="multoffset" then entity.light:SetShadowOffset(entity.light:GetShadowOffset(0,0),value,0) elseif key=="linearoffset" then entity.light:SetShadowOffset(value,entity.light:GetShadowOffset(1,0),0) else return base_SetKey(model,key,value) end end return 1 end --[[ dofile("Scripts/baseclass.lua") -- We need the base class entity dofile("Scripts/table.lua") -- We need the table.Inherit function -- Set this script"s Entity table to an inherit of BaseClass"s entity table EntityNew = { } Entity = table.Inherit(EntityNew, Entity) function Entity:Spawn(model) if (model == nil) then Notify("Entity passed to Entity:Spawn is nil") end Entity.BaseClass:Spawn(model) -- Since the entity object is passed to the BaseCLass spawn, it is in Entity.BaseClass.model, we need to either remove the above line and uncomment the one below, or simply leave both -- If you are wondering why Entity.model isn"t inherited at the top of the script when we called table.Inherit, it is because we had not yet defined an Entity.model variable -- You will come to notice that variables we assign via BaseClass functions AFTER inheritence will not exist from this Entity scope. We can still access them via Entity.BaseClass.variablename --Entity.model = Entity.BaseClass.model -- Hold onto you for later use and add it to this scope self.model = model model:SetKey("intensity","1") self.light = CreatePointLight(10,model) self.speed=1.0 end function Entity:SetKey(key,value) if self.model==nil then return 1 end if self.light==nil then self.BaseClass:SetKey(key,value) else if key=="resolution" then if value=="0" then self.light:SetShadowmapSize(256) elseif value=="1" then self.light:SetShadowmapSize(512) elseif value=="2" then self.light:SetShadowmapSize(1024) elseif value=="3" then self.light:SetShadowmapSize(2048) end elseif key=="muloffset" then self.light:SetShadowOffset(0,tonumber(value),0) elseif key=="range" then self.light:SetRange(value) elseif key=="shadowresolution" then resolution=self.light:GetShadowmapSize() if resolution==256 then return 0 elseif resolution==512 then return 1 elseif resolution==1024 then return 2 elseif resolution==2048 then return 3 else return -1 end else return self.BaseClass:SetKey(key,value) end end return 1 end function Entity:InitDialog(grid) self.BaseClass:InitDialog(grid) group=grid:AddGroup( "Light" ) group:AddProperty( "Resolution", "1|256,512,1024,2048", PROPERTY_CHOICE, "" ) group:AddProperty( "muloffset","|0,1,2",PROPERTY_FLOAT,"Mult offset" ) group:AddProperty( "range","|1,100,0",PROPERTY_FLOAT,"" ) group:Expand(1) end function Entity:ReceiveMessage(message,extra) if message=="toggle" then if self.model:Hidden()==1 then self.model:Show() else self.model:Hide() end else end end ]]--
  11. I think the title is self-descriptive. What's the simplest script to attach a point light to my model? Thanks.
  12. Awesome. I always loved Invision. By the way Josh, you can have a space in your name.
×
×
  • Create New...