Jump to content

Recommended Posts

  • 2 weeks later...
33 minutes ago, Master_MTA said:

there is a problem with the properties in oop

you can't use

element:getProperties()

oh also i tried to access to it with another way

    print(toJSON(element.getProperties(element)))
same thing empty table
+ there is a problem with setting only not getting position or size by this way
element.position.x = 10
--not working
Edited by Master_MTA
Link to comment
  • Scripting Moderators
13 hours ago, Master_MTA said:

there is a problem with the properties in oop

you can't use

element:getProperties()

fixed (both)

Edited by thisdp
  • Like 1
Link to comment
4 hours ago, thisdp said:

fixed (both)

thx works

 

4 hours ago, thisdp said:

fixed (both)

there is a problem with visible part

function dgsGetVisible(dgsEle)
	assert(dgsIsDxElement(dgsEle),"Bad argument @dgsGetVisible at argument 1, expect a dgs-dxgui element got "..dgsGetType(dgsEle))
	if dgsElementData[dgsEle].visible then
		local p = FatherTable[dgsEle]
		for i=1,5000 do
			if p then break end
			if not dgsElementData[p].visible then return false end
			p = FatherTable[p]
		end
		return true
	end
	return false
end

debug : attemp to index field  ? a nil value line 260 functions.Lua

Edited by Master_MTA
Link to comment
  • Moderators
if not p then
  return true -- there is no parent?
end

for i=1,5000 do
  	local data = dgsElementData[p]
	if not data then
		error("Data mismatch... go spam thisdp", 2)	
	end
 	if not data.visible then return false end
	p = FatherTable[p]
	if not p then break end
end

hmmm maybe... ? can't test it

Edited by IIYAMA
Link to comment

 

8 hours ago, IIYAMA said:
  • if not p then
  • return true -- there is no parent?
  • end
  •  

first thx for your help 

second i know that already but am telling him to update it in the GitHub project so when am trying to update the dgs after that there is no need to edit it every time i update it

that's why am spamming here :D cuze my project totally depending on the dgs lib +_+

ah by the way my solution was like that

function dgsGetVisible(dgsEle)
	assert(dgsIsDxElement(dgsEle),"Bad argument @dgsGetVisible at argument 1, expect a dgs-dxgui element got "..dgsGetType(dgsEle))
	if dgsElementData[dgsEle].visible then
		local p = FatherTable[dgsEle]
		for i=1,5000 do
			if not p then break end
			if not dgsElementData[p].visible then return false end
			p = FatherTable[p]
		end
		return true
	end
	return false
end

he just forgot not word on this line

            if then break end
-- so i edit it to be
            if not p then break end
 

 

Edited by Master_MTA
  • Like 2
Link to comment
  • Scripting Moderators
1 hour ago, Master_MTA said:

 

first thx for your help 

second i know that already but am telling him to update it in the GitHub project so when am trying to update the dgs after that there is no need to edit it every time i update it

that's why am spamming here :D cuze my project totally depending on the dgs lib +_+

ah by the way my solution was like that


function dgsGetVisible(dgsEle)
	assert(dgsIsDxElement(dgsEle),"Bad argument @dgsGetVisible at argument 1, expect a dgs-dxgui element got "..dgsGetType(dgsEle))
	if dgsElementData[dgsEle].visible then
		local p = FatherTable[dgsEle]
		for i=1,5000 do
			if not p then break end
			if not dgsElementData[p].visible then return false end
			p = FatherTable[p]
		end
		return true
	end
	return false
end

he just forgot not word on this line

            if then break end
-- so i edit it to be
            if not p then break end
 

 

thanks, this was a mistake when I am optimizing dgs code

  • Like 1
Link to comment

problem with this

            getPosition =  dgsOOP.genOOPFnc("dgsGetPosition"),
 
--oop

another mistake when am trying to 

                        local pax,pay = pa.position.x , pa.position.y
the pax is cool but pay  is  need to increase 25 to it to get real size
i suggest to add parameters to
dgsGetPosition To get The real height
Link to comment
  • Scripting Moderators
12 hours ago, Master_MTA said:

problem with this

            getPosition =  dgsOOP.genOOPFnc("dgsGetPosition"),
 
--oop

another mistake when am trying to 

                        local pax,pay = pa.position.x , pa.position.y
the pax is cool but pay  is  need to increase 25 to it to get real size
i suggest to add parameters to
dgsGetPosition To get The real height

why need 25 to get the real size?

Link to comment
5 hours ago, thisdp said:

why need 25 to get the real size?

the title bar

+ sorry i was mean dgsGetSize

+

dgsGetSize+dgsGetPosition -> both of them in oop return 1 value only which's x for pos and w forsize

ele:getSize()->w only

ele:getPosition()->x only

Edited by Master_MTA
Link to comment
On 04/06/2020 at 13:53, thisdp said:

fixed (both)

sorry i have question about parent system in your dxlib

let us assume there is a window

and this window have 2 buttons

the button 1 and button 2

let's assume that button 1 is parent for button 2

and window is parent for button 1

so is it true that when am try to get window children button 1 and button 2 is returned? 

as child for window

Edited by Master_MTA
Link to comment
  • Scripting Moderators
23 hours ago, Master_MTA said:

the title bar

+ sorry i was mean dgsGetSize

+

dgsGetSize+dgsGetPosition -> both of them in oop return 1 value only which's x for pos and w forsize

ele:getSize()->w only

ele:getPosition()->x only

Currently, I need some help with get type of "vector", I can't get the type of Vector/Vector2/...

44 minutes ago, Master_MTA said:

sorry i have question about parent system in your dxlib

let us assume there is a window

and this window have 2 buttons

the button 1 and button 2

let's assume that button 1 is parent for button 2

and window is parent for button 1

so is it true that when am try to get window children button 1 and button 2 is returned? 

as child for window

window is the parent of button1

button1 is the parent of button2

but window is not button2's parent, it is button2's grand parent

getChildren only gets parent, exclude grand parent

  • Like 1
Link to comment
On 07/06/2020 at 16:14, thisdp said:

Currently, I need some help with get type of "vector", I can't get the type of Vector/Vector2/...

 

sorry for being late

i was have online exams there is the soluation

getPosition gonna be in oop file

			getPosition =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetPosition",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

and 

getSize gonna be 

			getSize =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetSize",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

+_+

if you wanna  return it as vector

  getSize =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetSize",self.dgsElement,...)) return (pos and pos) or false 
end
 
Edited by Master_MTA
Link to comment
  • Scripting Moderators
21 minutes ago, Master_MTA said:
 

sorry for being late

i was have online exams there is the soluation

getPosition gonna be in oop file


			getPosition =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetPosition",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

and 

getSize gonna be 


			getSize =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetSize",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

+_+

if you wanna  return it as vector

  getSize =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetSize",self.dgsElement,...)) return (pos and pos) or false 
end
 

I had to solve something like label:setSize(label:getSize)

Link to comment
1 hour ago, thisdp said:

label:getSize

sure am gonna find it out now just sec

1 hour ago, thisdp said:

I had to solve something like label:setSize(label:getSize)

 

2 hours ago, Master_MTA said:

Position gonna be in oop file


			getPosition =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetPosition",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

and 

getSize gonna be 


			getSize =function(self,...) local pos = Vector2(call(dgsOOP.dgsRes,"dgsGetSize",self.dgsElement,...)) if pos then return pos.x,pos.y end return false end,

+_+

just use this it's works for me

1 hour ago, thisdp said:

label:getSize

 

Link to comment
  • 1 month later...

EDIT :   IDK WHAT I MADE BUT IS NOW WORKING -------------------------------------------






them i apply the code :

DGS:dgsSetVisible( Edit, false )
DGS:dgsFocus(image1)
DGS:dgsSetEnabled ( Edit, false )

disappears correctly but cursor still on screen. only clicking somewhere the cursor show off.
How can i do to cursor show off with the dgsSetVisible false.

another thing is if i m in car doing this the edit box dont type the letters
 

Edited by DaeRoNz
Link to comment
  • Scripting Moderators
On 07/08/2020 at 06:55, DaeRoNz said:

EDIT :   IDK WHAT I MADE BUT IS NOW WORKING -------------------------------------------






them i apply the code :


DGS:dgsSetVisible( Edit, false )
DGS:dgsFocus(image1)
DGS:dgsSetEnabled ( Edit, false )

disappears correctly but cursor still on screen. only clicking somewhere the cursor show off.
How can i do to cursor show off with the dgsSetVisible false.

another thing is if i m in car doing this the edit box dont type the letters
 

I need further information about this. Try to give a string of complete code that can reproduce this problem.

Link to comment
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...