Raised This Month: $51 Target: $400
 12% 

how to set native for property


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LinLinLin
Senior Member
Join Date: Sep 2021
Old 03-03-2023 , 09:53   how to set native for property
Reply With Quote #1

i make a methodmap like this
PHP Code:
methodmap Tank
{
    public 
Tank(int tank)
    {
        return 
view_as<Tank>(tank); 
    }

    public 
native SetType(int type); 
    
property int Type
    
{
        public 
native get()
        public 
native set(int type)
    }

PHP Code:
// this is in sp
public APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
CreateNative("Tank.SetType"Native_Tank_SetType);
    
// CreateNative("Tank.GetType", Native_Tank_GetType);
    
return APLRes_Success;
}
any Native_Tank_SetType(Handle pluginint numParams)
{
    

so how can we use CreateNative() for property
like CreateNative("Tank.Type", Native_Tank_Type)?
but one property has two native, so the "Native_Tank_Type" maybe has some problem?
or someone can explain it.

Last edited by LinLinLin; 03-03-2023 at 09:54.
LinLinLin is offline
LinLinLin
Senior Member
Join Date: Sep 2021
Old 03-03-2023 , 10:04   Re: how to set native for property
Reply With Quote #2

ok, solved.
the native should be
CreateNative("Tank.Type.Set", Native_Tank_Type)
two point in the name to define the property and there func.
LinLinLin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode