RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-495269

Vint Planov's questions

Martin Hope
Vint Planov
Asked: 2022-08-10 01:34:17 +0000 UTC

React Three js Fiber没有从链接加载纹理

  • 0

如何从链接加载纹理 - 没有 React 导入?任务是:制作一个圆圈,其中会有一张从后端链接中拍摄的人的照片......

import React from "react";
import { usePlane } from "@react-three/cannon";
import { useLoader } from "@react-three/fiber";
import { TextureLoader } from "three/src/loaders/TextureLoader";
import gamerPhoto from "./../../../assets/images/profile_pictures/Regular_face_1.png";

const Gamer = ({texture, refGamer}) => {

// Работает, но с импортом мне не надо
const texture = useLoader(TextureLoader, gamerPhoto);

// Не работает Uncaught Could not load ./../../../assets/images/profile_pictures/Regular_face_1.png: undefined
const texture = useLoader(TextureLoader, "./../../../assets/images/profile_pictures/Regular_face_1.png");

// Ни относительно файла, ни относительно reducer, ни просто ссылка, ни прямая http ссылка взятая с гугла (в браузере открывается):
// "./../../../assets/images/profile_pictures/Regular_face_1.png"
// "./../assets/images/profile_pictures/Regular_face_1.png"
// "assets/images/profile_pictures/Regular_face_1.png"
// "https://codeworkshop.dev/static/8a5b2989e06c0d8376faabd9a879dbf9/fcb16/frontendbackend.jpg"

const [refGamer] = usePlane(() => ({
        position: [0, 0, 0],
    }));
  
 
    
    return (
        <mesh ref={refGamer}>
            <circleGeometry args={[1, 35]} />
            <meshStandardMaterial map={texture} />
        </mesh>
    );
};

reactjs three.js
  • 1 个回答
  • 15 Views
Martin Hope
Vint Planov
Asked: 2022-09-04 18:35:30 +0000 UTC

透明 .png 区域(背景图像)与背景重叠

  • 0

我使用来自.png的背景图像制作了一个图像形式的按钮,带有透明区域。

这些透明区域覆盖了方块的背景: 背景按钮

body {
  background-color: white;
}

.btn {
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.btn:hover,
.btn:focus {
  box-shadow: inset 0px 0px 8px 1px rgba(63, 84, 112, 0.1);
}

.btn-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 300px;
  height: 300px;
  background-color: white;
}

.reduct-btn {
  width: 200px;
  height: 200px;
  /* Не помогает ни transparent ни white */
  background-color: white;
  background-image: url("./img/iconNo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="styles.css">
  <title>Document</title>
</head>

<body>

  <div class="btn-wrap">
    <button class="btn reduct-btn"></button>
  </div>


</body>

</html>

css background
  • 1 个回答
  • 17 Views
Martin Hope
Vint Planov
Asked: 2022-06-14 22:00:19 +0000 UTC

如何在本机反应中添加图像?有图书馆吗?

  • 1

一个任务!我们从本地文件夹中的 props 中获取到图像的相对链接,我们将 props </View> 中的图像替换为容器组件 <View>

尝试过的选项:

  1. 默认情况下,<Image source={require('')} /> 组件将图片嵌入到应用程序中,但链接不是从props中动态获取的;
  2. < Image source={ {uri : 'http://'} } /> - 不从 assets/ 文件夹中加载,仅从 Internet 加载;
  3. 来自 github github.com/expo/expo-pixi 的 expo-pixi - 无论是通过示例还是通过视频,都无法设置互联网上唯一的 YouTube!除了我,这个世界上没有人需要在 React Native 中处理图片!是的,为图片加载游戏引擎就是这样的事情!

是否有一些简单的东西——比如库/组件——来显示一个简单的 .jpeg 图像?让它比 expo-pixi 图形引擎更容易?- 您无法立即弄清楚...

const Exercise = (props) => {

    return (
        <View style={styles.exercise}>

//////////Не берёт из source={{uri: props.img}}!///////
            <View style={styles.exercise__imgBlock}>
                <Image style={styles.exercise__img} 
                    source={{uri: props.img}} />

////// Или это тоже никак нее работает!/////////
////// Ни по http://, ни по локальным ссылкам /////

                {/* <GLView
                    style={{ flex: 1,  width: '100%', height: '100%' }}
                    onContextCreate={async (context) => {
                        const app = new PIXI.application({ context });
                        const sprite = await PIXI.spriteAsync ( 
                            'https://el-dent.ru/UserFiles/Image/img2484_21094_big.jpg'
                        );
                        
                        app.stage.addChild(sprite);
                    }}
                /> */}
            </View>
            
        </View>
    );
};

const styles = StyleSheet.create({
    exercise: {
        flexDirection: 'row',
        justifyContent: 'flex-end',
        alignItems: 'center',

        marginBottom: 10,
        width: '100%',
    },
    exercise__block: {
        width: 30,
        height: 40,
        marginRight: 5,

        borderColor: '#FFC000',
        borderStyle: 'solid',
        borderWidth: 2,
        borderRadius: 10,
    },

    exercise__imgBlock: {
        width: 120,
        height: 80,
        marginRight: 10,
        marginLeft: 20,
        backgroundColor: 'darkgrey',
        borderColor: '#FFC000',
        borderStyle: 'solid',
        borderWidth: 2,
    },
    exercise__img: {
        width: '100%',
        height: '100%',
        // width: 100,
        // height: 100,
        resizeMode: 'contain'
    },

});

react-native expo
  • 1 个回答
  • 231 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5