Jump to content

DooMAGE

Members
  • Posts

    308
  • Joined

  • Last visited

Posts posted by DooMAGE

  1. On 07/07/2017 at 7:23 PM, Josh said:

    OK, I will show everyone how the widgets can be modified to do anything you want.

    Would be great if we had an official tutorial about that, I'm trying to do the same as our friend in this thread, and I'm sure since this is an official feature others devs will have trouble to figure out how to mod or create new stuff with the new LE widget system time to time again.

    There is some undocumented stuff like SetObject.

    For example I'm trying to do something simple like change the font size of the main buttons (New Game, Options and Quit), and looks like that there is no function or parameter in the widgets to do that.

    https://www.leadwerks.com/learn?page=API-Reference_Object_Widget_SetString

    • name: name of the variable to set.
    • value: value to set.

    Its not enough, what are the values I can set? You use "Link" in your example (menu.lua) what are the other types?

    I feel so lost with this feature :(

  2. Update.

    It's working now, I use world:pick to raycast and test if the pickinfo I got is the object I want to show.
    Since the raycast wont work with hidden objects, I am changing its materials.

    Now the catch is, How can I detect if my raycast is not hitting the object I got before, so I can put the original material back?

    Tried this but my lastValidPickinfo thing is not working:

    if self.entity.world:Pick(p0,p1, pickinfo, 0, true) then 
      if pickinfo ~= nil then
        if pickinfo.entity ~= nil and pickinfo.entity:GetKeyValue("name") ~= "" then
          self.lastValidPickinfo = pickinfo
          pickinfo.entity.script.showObject = true
    
          if self.lastValidPickinfo.entity:GetKeyValue("name") == "" then
            self.lastValidPickinfo.entity.script.showObject = false
          end
      end
    end

     

  3. On 04/05/2015 at 8:47 PM, Rick said:

     

    You may know that but a new person coming into LE and only has Lua version isn't going to know that.

    Good point. Anyone know the name of the classes? I don't have visual studio instaled yet

  4. Hello,

    I'm trying to modify the FPSPlayer.lua to show hidden objects with the flashlight, but its not working.

    What I am doing wrong? :P

    function Script:UpdateWorld()
      local pickinfo=PickInfo()
    	
      local p = self.flashlight:GetPosition() 
        if (self.camera:Pick(p.x,p.y,pickinfo,0.5,true)) then
          pickinfo.entity:Show()
        end
    end

    Edit - I guess I should use world:pick instead?

×
×
  • Create New...