小编Tar*_*sus的帖子

如何使用通用渲染管线 (URP) 在 Unity 中获得透明的游戏窗口?

过去,在Unity中,你可以使用Unity中的DwmExtendFrameIntoClientArea,在桌面上绘制一个透明的游戏窗口,让所有游戏对象都出现在桌面本身。这是使用传统渲染管道完成的。

参考:https : //forum.unity.com/threads/solved-windows-transparent-window-with-opaque-contents-lwa_colorkey.323057/page-2

现在,我有一个内置 URP 的应用程序,我想达到相同的效果,但不知道该怎么做。降级到遗留渲染管道并不是一个真正的选择,因为它在这一点上是遗留的。

有谁知道如何使用 URP 在桌面上绘制透明的游戏窗口?如果有帮助,我只需要它在 Windows 10 中工作。

谢谢。

c# windows unity-game-engine urp

7
推荐指数
1
解决办法
119
查看次数

如何通过视图传递点击事件?

所以我有3个视图,一个大视图另外两个视图.顶部的那个是透明的.我希望能够onTouch在顶部的大背后的观点上注册一个事件,而大的一个什么都不做.

怎么能这样做?

android

6
推荐指数
1
解决办法
3734
查看次数

如何在线性布局中更改视图的位置.

所以我有一个已经填充了子项的线性布局.有没有办法改变其中一个孩子的位置?

如果有任何帮助的话,我正试图交换他们之间的观点.

final LinearLayout parrent = (LinearLayout)findViewById(R.id.llWidgetScreen);
    final LinearLayout Delailah = new LinearLayout(this);
    Delailah.setLayoutParams(new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
    AppWidgetHostView wedgy = attachWidget(mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo));
    Delailah.addView(wedgy);
    final Button btn = new Button(this);
    btn.setLayoutParams(new android.widget.LinearLayout.LayoutParams((int)(20*scale +0.5f), android.view.ViewGroup.LayoutParams.FILL_PARENT, 0f));
    btn.setOnLongClickListener(new OnLongClickListener() {

        @Override
        public boolean onLongClick(View v) {
            parrent.removeView(Delailah);
            return false;
        }
    });
    btn.setBackgroundColor(mainColor);
    btn.setText(parrent.getChildCount()+1+"");
    btn.setTextColor(textColor);
    btn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            if(ReadyForDrag==0)
            {
                btn.setBackgroundColor(actiColor);
                ReadyForDrag++;
                DragPosition1=Integer.parseInt(btn.getText().toString());
            }
            else if(ReadyForDrag==1)
            {
                btn.setBackgroundColor(actiColor);
                ReadyForDrag=0;
                LinearLayout v1 = (LinearLayout)parrent.getChildAt(DragPosition1);
                LinearLayout v2 = (LinearLayout)parrent.getChildAt(Integer.parseInt(btn.getText().toString()));
                //move …
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
8461
查看次数

标签 统计

android ×2

c# ×1

unity-game-engine ×1

urp ×1

windows ×1