Jump to content

deathismyfriend

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by deathismyfriend

  1. @macklebee thanks that will help a bit. Always had 20 or 30 pages open when using leadwerks for the API information.
  2. @#2 macklebee Thanks for the link and information. This will be a lot better than before.
  3. I would like to see the ability to have a list / group of entities in the script properties. Currently you can only add one. Script.entity = ""--entity "Entity" I would like to see an option somewhat like this. Script.entities = {}--entities "Entities" This way we can pass in a group of entities rather than having a ton of entity objects.
  4. I would like to see an API manager in the leadwerks client itself. So that you do not need to go online all the time when looking up some part of the API. I would also like to see Intellisense to make typing easier and prevent some simple bugs that can happen from mistypes. Thanks and great client so far I like it.
  5. Hello everyone, I have a problem in my script where the wrong text is being displayed on all objects. I was hoping to add this to steam for everyone to use. This is my first attempt at using tables. Maybe I made a mistake there ? This script is used to display a text on an entity. It does display the text but it only displays the last text that has been created. I have checked to make sure that the entities and the buffers are different. Along with checking that the text to be displayed is correct (it prints out the correct text to be displayed on the object but does not show the correct text on screen). Here is the script. Also sorry for the indentation. Script.text = ""--string "Text" Script.color = Vec4()--color "Text Color" Script.choice = 0--choice "Text Align" center,left,right Script.textFont = ""--path "Font" "Font (*.ttf):ttf|ttf Files" Script.sizeFont = ""--int "Font Size" Script.locationText = Vec2()--vec2 "Text Location" Script.font = nil Infos = {} Info = { entity = "", text = "",--string "Text" color = Vec4(),--color "Text Color" choice = 0,--choice "Text Align" center,left,right textFont = "",--path "Font" "Font (*.ttf):ttf|ttf Files" sizeFont = "",--int "Font Size" locationText = Vec2(),--vec2 "Text Location" font = nil, buffer = nil, New = function() info = {} for k, v in pairs(Info) do info[k] = v end return info end, --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. RenderText = function(this, context) Buffer:SetCurrent(this.buffer) context:SetFont(this.font) context:SetColor(this.color) context:DrawText(this.text, this.locationText.x, this.locationText.y)[/indent] [indent=1]--I checked the text here to see what should be displayed and it had the correct ones being displayed.[/indent] [indent=1]--Only the last text to be run through this though was actually being displayed on all entities that this was handling. this.entity:GetMaterial():SetTexture(this.buffer:GetColorTexture(0),0) end } function Script:Start() local info = Info.New() info.entity = self.entity info.text = self.text info.color = self.color info.choice = self.choice info.textFont = self.textFont info.sizeFont = self.sizeFont info.locationText = self.locationText info.font = Font:Load(self.textFont, self.sizeFont) info.buffer = Buffer:Create(100,100,1,1) Infos[self.entity] = info end --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. function Script:PostRender(context) local oldBuffer = Buffer:GetCurrent() context:SetBlendMode(Blend.Alpha) for k, v in pairs(Infos) do Infos[k]:RenderText(context) end Buffer:SetCurrent(oldBuffer) end
×
×
  • Create New...